Register / Login
Object Relational Mapping
EclipseLink, Query-By-Example for Entilty with One-To-Many relationship
posted 7 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 ?
How many objects will create
Duplicate results in Hibernate many to many mapping.
EJB Query Help