Menu

find in Collection

2004-10-08
2013-03-07
  • Nobody/Anonymous

    Hi.
    How i can find a object into collection or i have use a for each.

    I want controler object duplicate in a asociation oneToMany.

    Saludos

    Victor

     
    • Richard Banks

      Richard Banks - 2004-10-10

      You can either do a "for each", implement your own search method, override the index method of collectionbase as pass an specific object to find or do something else entirely.

      If you want to avoid duplicate objects in a oneToMany association you can override the add method to scan for the same object first and throw an exception if there is a duplicate.

      - Richard.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.