Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Getting sub-collection in SELECT statement

Hi,
 
I have probably a stupid question, but I don't seem to find the answer in
the documentation.
 
I have an entity called RelationNodeEntity. There I have a foreign key to
NodeEntity and RelationNodeEntity along with other properties. Anyway, I
want to load the NodeEntity when RelationNodeEntity complies to certain
parameters.
 
I have this example code (snippet):
 
Expression relatioNodeExpression = new
ExpressionBuilder(RelationNodeEntity.class);
        
Expression step1 = 
               
relatioNodeExpression.get(RelationNodeEntity.FIELD_RELATION).
               
get(RelationEntity.FIELD_ID).equal(relationEntity.getRelationId());
        
Expression step2 = step1.and(... other expression - irrelevant);
        
ReadAllQuery query = new ReadAllQuery(RelationNodeEntity.class, step2);
 
But then I get the RelationNodeEntities. How can I change the SELECT
statement that the query only selects the NodeEntity object? It works in
EQL, there I write "SELECT r.nodeEntity FROM RelationNodeEntity r". What am
I doing wrong or which mistake do I make here?
 
Thanks,
Jan De Cooman
-- 
View this message in context: http://www.nabble.com/Getting-sub-collection-in-SELECT-statement-tp21992105p21992105.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top