Bugs item #565325, was opened at 2002-06-06 09:14
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=565325&group_id=22866
Category: JBossCMP
Group: v3.0 Rabbit Hole
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Bogdan Ghidireac (ghidi)
>Assigned to: Dain Sundstrom (dsundstrom)
Summary: generated-sql not executed correctly
Initial Comment:
Hi,
I have created a finder that is using declared-sql.
The problem is that the generated sql does not
substiture "?" with the actual value of the parameter as
you can see in the log generated by HypersonicSQL.
[jbosscmp-jdbc.xml]
<entity>
<ejb-name>Employee</ejb-name>
<query>
<query-method>
<method-
name>findEmployeesByPattern</method-name>
<method-params>
<method-param>java.lang.String</method-
param>
</method-params>
</query-method>
<declared-sql>
<where>firstName LIKE '{0}%'</where>
</declared-sql>
</query>
</entity>
JbossCMP log
17:08:05,054 DEBUG [findEmployeesByPattern]
Executing SQL: SELECT employeeId, firstName,
lastName, address, sSN, email FROM EMPLOYEE
WHERE firstName LIKE '?%'
HypersonicSQL log
17:08:05,064 INFO [STDOUT] 3:SELECT employeeId,
firstName, lastName, address, sSN, email FROM
EMPLOYEE WHERE firstName LIKE '?%'
I am using Jboss3.0.0 final.
Regards,
Bogdan
----------------------------------------------------------------------
>Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-06-06 09:30
Message:
Logged In: YES
user_id=251431
It is not legal to try to put a parameter in a literal. This is a
JDBC thing not a JBoss thing. Try this instead.
<where>firstName LIKE CONCAT({0}, '%')</where>
It should work, but if it doesn't it is still not a JBoss bug, so
I'm going to close this report.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=565325&group_id=22866
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development