[jboss-user] [EJB 3.0] - Re: entityManager.find() returns null
tboswell
do-not-reply at jboss.com
Wed Sep 20 07:51:13 EDT 2006
It turns out our friend wolfc is correct. Oracle will return either a CHAR(8) or VARCHAR2(8) value padded out with spaces till the end.
Only a search for:
entityManager.find(Language.class, "en ");
will return the correct row. This works fine when you are following relationships etc as the padded value is passed around.
Not sure how best to deal with this as trailing whitespace, although unlikely it is possible in a PK column...or any column you are querying (same problem surely?). So trimming the column value may be just as bad.
Any idea how to ensure consistency here? Could force the entity to always pad values as well i guess. Ultimately its Oracle's oversight I guess....
Tom.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972898#3972898
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972898
More information about the jboss-user
mailing list