Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » JPQL Question - empty string
JPQL Question - empty string [message #1066318] Tue, 02 July 2013 03:28 Go to next message
Reiner Lott is currently offline Reiner Lott
Messages: 7
Registered: April 2013
Junior Member

in my SQL Client i used the following statement:

select * from mytable where value = ''

--> returns resultset


the JPQL pendant would be:

select m from entityname m where m.value = ''

--> returns nothing


but this works:

select m from entityname m where m.value = ' '

is this a bug?


Re: JPQL Question - empty string [message #1066640 is a reply to message #1066318] Wed, 03 July 2013 10:20 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

My guess is your JDBC driver is doing some odd translation of the SQL. You can enable logging to see the SQL that EclipseLink generates.
EclipseLink does not do anything special with '' or ' '.

Also try using a parameter instead of inlining the string.

James : Wiki : Book : Blog : Twitter
Previous Topic:Nulling an embedded object does not affect the database upon merge
Next Topic:Eclipse link DBWS -Connection is null
Goto Forum:

Current Time: Fri Aug 22 06:06:24 EDT 2014

Powered by FUDForum. Page generated in 0.02242 seconds