[JPA] CONCAT in update query
563606Feb 23 2007 — edited Mar 12 2007Hello.
I'm trying the new JPA API using TopLink and other implementations such as Hibernate.
Everything in my simple tests seems to work fine, but an update query doesn't produce what i'm expecting. In this case, Hibernate works perfectly...
For information i'm using the Derby database, version 10.1.2.1, in client-server mode, and the last build 36 of the TopLink glassfish JPA RI (from Oracle site)...
The query works on a simple entity named 'Thing', trying to change a string/varchar property value using the CONCAT function :
"update Thing t set t.description = CONCAT(t.description, '-UPDATED') where t.identifier like '%3-%'"
Enabling finest logs, the following translation of the statement appears :
UPDATE THING SET DESCRIPTION = VARCHAR(DESCRIPTION || '-UPDATED') WHERE (THING_IDENTIFIER LIKE '%3-%'
I've tried the same SQL statement dierctly against the derby db, and for sure it doesn't work, ending with the same bad values ! For example, for an original field value "Test...T#3-1172242788995", the resulting updated value is "Test...T#3-1172" instead of the expected "Test...T#3-1172242788995-UPDATED"...
An idea ? Should I specify the target derby base somewhere ?
Thanks for your help...