3 Replies Latest reply on May 1, 2005 5:59 PM by Emmanuel Bernard

    "findBy" in reference after entity detached?

    Alec Solway Newbie

      I have the following type of situation: a @OneToMany relationship, EAGER fetch, the object on the "One" side is detached. Now I have access to the "Many" objects and can iterate over them, but instead, I would like to quickly access one using one of the properties, e.g.


      instead of having to iterate over department.getUsers() and check each name to match bob.

      Is there anything (automatic?) in place to make this simple? Or do I have to resort to making another function (e.g. getUserByName) to hide the iteration, or map users to a Hashtable when they first come in?