Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » criteria builder missing a condition
criteria builder missing a condition [message #778455] Thu, 12 January 2012 14:29 Go to next message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 817
Registered: July 2009
Senior Member
I'm trying to create a where clause resembling: "stage = ? and approvedby is not null"

This is the builder code:
lCriteriaQuery = lCriteriaQuery.select(lBuyorderRoot).where(
lCriteriaBuilder.and(
lCriteriaBuilder.equal( lBuyorderRoot.get(Buyorder.STAGE_FIELD_ID), Buyorder.STAGE_ENTERED),
lCriteriaBuilder.isNotNull( lBuyorderRoot.get(Buyorder.APPROVEDBYEMPLOYEE_FIELD_ID) )
)
);

This is the generated SQL:
SELECT ... FROM buyorder WHERE (stage = ?)

Why is the approvedby missing?
Re: criteria builder missing a condition [message #779903 is a reply to message #778455] Mon, 16 January 2012 19:38 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Seems to work for me.

Ensure you are compiling and deploying your code correctly. Also ensure you are testing the latest release.


James : Wiki : Book : Blog : Twitter
Re: criteria builder missing a condition [message #779906 is a reply to message #778455] Mon, 16 January 2012 19:38 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Seems to work for me.

Ensure you are compiling and deploying your code correctly. Also ensure you are testing the latest release.
--
James : http://wiki.eclipse.org/EclipseLink : http://en.wikibooks.org/wiki/Java_Persistence : http://java-persistence-performance.blogspot.com/


James : Wiki : Book : Blog : Twitter
Re: criteria builder missing a condition [message #780081 is a reply to message #779903] Tue, 17 January 2012 06:26 Go to previous message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 817
Registered: July 2009
Senior Member
I'm 100% certain this is the code being run (debugged it), but I cannot upgrade to 2.3.0 because of a known issue with the embedded ASM.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=358287

This bug also prevents me from upgrading to Java 7, which requires 2.3.0.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=339388

Tom


On 2012-01-16 20:38, James Sutherland wrote:
> Seems to work for me.
>
> Ensure you are compiling and deploying your code correctly. Also ensure you are testing the latest release.
Previous Topic:Auto generated Id - Optional late binding mechanism
Next Topic:Metamodel not being created until after first use
Goto Forum:
  


Current Time: Thu Apr 25 20:56:12 GMT 2024

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

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

Back to the top