Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » QueryException occurs on an expression that is using getAllowingNull() on an aggregate attribute.(Exception Description: An outer join (getAllowingNull or anyOfAllowingNone) is only valid for OneToOne, OneToMany, ManyToMany, AggregateCollection and DirectCollection Mappings, and cannot be used for)
QueryException occurs on an expression that is using getAllowingNull() on an aggregate attribute. [message #813661] Mon, 05 March 2012 10:18 Go to next message
Dragomir Zoranovic is currently offline Dragomir Zoranovic
Messages: 7
Registered: February 2012
Junior Member
Hi,

I have query defined as follows:

ReadAllQuery query = new ReadAllQuery(User.class);
ExpressionBuilder eb = new ExpressionBuilder(User.class);
query.addOrdering(eb.getAllowingNull("aggregateUser").get("aggregateName"));

Attribute aggregateUser is defined as aggregate object of the object User.This query throws following QueryException:

Exception Description: An outer join (getAllowingNull or anyOfAllowingNone) is only valid for OneToOne, OneToMany, ManyToMany, AggregateCollection and DirectCollection Mappings, and cannot be used for the mapping [org.eclipse.persistence.mappings.AggregateObjectMapping].

Should I prevent using getAllowingNull() on agreggate attibutes? Or is there any another solution?



[Updated on: Mon, 05 March 2012 10:23]

Report message to a moderator

Re: QueryException occurs on an expression that is using getAllowingNull() on an aggregate attribut [message #813749 is a reply to message #813661] Mon, 05 March 2012 12:08 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1834
Registered: July 2009
Senior Member
Just use get(), getAllowingNull() is only for outer joins, and you are not joining.


James : Wiki : Book : Blog
Previous Topic:Oracle11g-HSQLDB
Next Topic:JPA and Temporal Databases
Goto Forum:
  


Current Time: Tue May 21 08:47:11 EDT 2013

Powered by FUDForum. Page generated in 0.01594 seconds