• Post Reply Bookmark Topic Watch Topic
  • New Topic

can someone tell me the finder query

 
kashif iftikhar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using weblogic6.0 and ejb2.0
i am tring to write ejb-ql that gives same result as of the following Oracle\sql query.
oracle\sql query is.
select ename from emp where ename like 'smi%';
this query returns all names start with "smi"
corrosponding ejb-jar finder method is..
<query>
<query-method>
<method-name>findName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>
<[![CDATA[FROM EmpBean AS c WHERE c.ename >= ?1]]>
</ejb-ql>
</query>

if i right c.ename >= ?1 it returns almost all names
<br>
if i right c.cname like ?1 it return me names that exectly match parameter(?1)

i want that it only return me names that start with parameter(?1).

thanks
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The LIKE operator can not be used with input paremeters. The comparison pattern must be known at deployment time. Sorry. You can't use EJB-QL to do what you want.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!