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 15:18 Go to next message
Dragomir Zoranovic is currently offline Dragomir ZoranovicFriend
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 15: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 17:08 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Just use get(), getAllowingNull() is only for outer joins, and you are not joining.


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


Current Time: Sat Nov 29 04:07:47 GMT 2014

Powered by FUDForum. Page generated in 0.02154 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software