Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Using QueryKeys in EclipseLink 2.1.0

I have see my mistake with the EclipseLink-criteria-query. (I should have read the error message till the end.) The query should have been of course like this:
_expression_ exp = eb.getAllowingNull("correspondingTaxEntity").get("incomeTaxClass").equal("5");
And it does exactly like the left-outer-join-jpql-query :-)

So, the remaining question is: Will the query-key-feature be available also with JPA-criteria-queries?

-- Frank
Frank Schwarz wrote:
There is also something weird with EclipseLink-criteria (or me misunderstanding the API):

This one works:
_expression_ exp = eb.get("correspondingTaxEntity").get("incomeTaxClass").equal("5");

But this one does not (despite that the JPQL-query did work as expected):
_expression_ exp = eb.get("correspondingTaxEntity").getAllowingNull("incomeTaxClass").equal("5");
org.eclipse.persistence.exceptions.QueryException: 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.DirectToFieldMapping[correspondingTaxEntity-->TEST.TAXENTITY.INCOMETAXCLASS]].


View this message in context: Re: Using QueryKeys in EclipseLink 2.1.0
Sent from the EclipseLink - Users mailing list archive at Nabble.com.

Back to the top