-
1. Re: jboss-3.2.0 : Problem with EJBQL
pdelgado0 Apr 22, 2003 12:15 PM (in response to kvikram)I think your query should be ...
<ejb-ql>
[CDATA[SELECT OBJECT(u) FROM Users u WHERE u.usertype = ?1]]
</ejb-ql>
with u.usetype in lowercase letters (because I suppose usertype is the field name and is in lowercases)
Due ?1 is a java.lang.String I don't know if you need to put ?1 between '?1'
If putting usertype in lowercase does not work try the latter.
Let me know if if helped you.
Good luck.
Pablo -
2. Re: jboss-3.2.0 : Problem with EJBQL
kvikram Apr 23, 2003 1:24 AM (in response to kvikram)Hi Pablo
My column name is UserType.
But Changing from u.USERTYPE to u.usertype solved the problem.
I never doubted it cause "sql statements are supposed to be non case sensitive".
Tried the 2nd option too. It didn't throw any exceptions But didn't fetch any results. Maybe because it isn't a well formed
"java.sql.PreparedStatement".
Thanx a lot
Vikram -
3. Re: jboss-3.2.0 : Problem with EJBQL
brettconnor Apr 24, 2003 12:59 PM (in response to kvikram)The terminal name refers to the name as per the abstract getter / setter convensions, ie remove the [gs]et. While SQL is not case sensitive, EJB-QL is not SQL, and is case sensitive in some parts. You will find the same on schema name also I think.
Re the = ?1 vs '?1', the second form will return no rows because it will be looking for rows where the usertype column has the literal value "?1", ie it's treating it as a literal rather than a variable.