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 07:28 Go to next message
Reiner Lott is currently offline Reiner LottFriend
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 14:20 Go to previous message
James Sutherland is currently offline James SutherlandFriend
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:EclipseLink 2.5 JPA + MONGODB and ORDER BY
Next Topic:Cache coordination per entity type
Goto Forum:

Current Time: Mon Mar 19 20:41:05 GMT 2018

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

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