Register / Login
this forum made possible by our volunteer staff, including ...
Stephan van Hulst
Object Relational Mapping
EclipseLink, Query-By-Example for Entilty with One-To-Many relationship
posted 8 years ago
I ma using EclipseLink 1.2, I wanted to know how to use Query-By-Example for One-To-Many relationship ?
I have two entities ResultGroup and CssObject.
ResultGroup has a unidirectional one-to-many relationship with CssObject. I want to find all the group objects that match a condition on child CssObject.
ReadAllQuery query = new ReadAllQuery(); ResultGroup group = new ResultGroup(); CssObject base= new CssObject(); base.setPing("xys"); group .getCssObjects().add(base); query.setExampleObject(group ); List results = (List) session.executeQuery(query);
This code returns all group objects. am I doing something wrong ? How can I make it return only those objects that satisfy the specified condition ?
Boost this thread!
How many objects will create
Duplicate results in Hibernate many to many mapping.
EJB Query Help