manytomany avec heritage
@Entity
@NamedQuery(name = "findMyObjects", query = "SELECT mo FROM MyObject mo")
public class MyObject implements Serializable
{
@OneToMany
protected Collection<A> collectionOfA;
...
Collection<A> getCollectionOfA()
{
return collectionOfA;
}
}
// Dans l'EJB Session
// The query used to find MyObjects
Query findMyObjects = entityManager.createNamedQuery( "findMyObjects" );
// Get the list of MyObject
Collection<MyObject> myObjects = findMyObjects.getResultList();