[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Maybe a bug on EntityManager.createNativeQuery(String)
petrilla
do-not-reply at jboss.com
Wed Jul 19 12:02:22 EDT 2006
I need to do some sql native query (to a data base Oracle 9i) from an EJB session Bean.
I use Jboss in version 4.0.4 G.A. patch 1
My simple code :
public List doNativeQueryMultiple(String sqlQuery) {
List list = manager.createNativeQuery(sqlQuery).getResultList();
return list;
}
This is some exemple for understand the probleme.
SELECT 'OUI' val FROM dual union SELECT 'NON' FROM dual Order BY 1 asc
Response is : O,N
SELECT 'TOTO' val FROM dual union SELECT 'NON' FROM dual Order BY 1 asc
Response is : TOTO,NON
SELECT 'TOT' val FROM dual union SELECT 'NON' FROM dual Order BY 1 asc
Response is : T,N
SELECT 'OUI' val FROM dual union SELECT 'abc' FROM dual Order BY 1 asc
Response is : O,a
SELECT 'OUI' val FROM dual union SELECT 'abcd' FROM dual Order BY 1 asc
Response is : OUI,abcd
SELECT 'OUI' val FROM dual union SELECT 'NON' FROM dual union SELECT 'TOT' FROM dual Order BY 1 asc
Response is : O,N,T
SELECT 'OUI' val FROM dual union SELECT 'NON' FROM dual union SELECT 'TOTO' FROM dual Order BY 1 asc
Response is : OUI,NON,TOTO
When the response of the request is correct, the return class type is java.lang.String
And when is incorrect , the return class type is java.lang.Charactere, and the response contain the first letter.
The bug is when the size of all of the selected string have the same length.
The test done by Jboss for determine the class return type maybe is wrong.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959197#3959197
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959197
More information about the jboss-user
mailing list