Answers for "manytomany avec heritage"

0

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();
Posted by: Guest on July-05-2021

Browse Popular Code Answers by Language