aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes cmp finder method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "cmp finder method" Watch "cmp finder method" New topic
Author

cmp finder method

alec stewart stewart
Ranch Hand

Joined: Dec 23, 2003
Posts: 71
hi all
i am not being able to understand what is wrong with my query

<query>
<query-method>
<method-name>findByName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql><![CDATA[SELECT Object(Story) FROM story AS Story WHERE Story.storyId = ?]]></ejb-ql>
</query>

it gives the follwing error on deployment:
org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement
'SELECT Object(Story) FROM story AS Story WHERE Story.storyId = ?'; - nested
throwable: (org.jboss.ejb.plugins.cmp.ejbql.TokenMgrError: Lexical error at line 1, col
umn 66. Encountered: <EOF> after : "")

if i use this then it works fine
<ejb-ql><![CDATA[SELECT Object(Story) FROM story AS Story WHERE Story.storyId = 6]]></ejb-ql>

but then it becomes hardcoded

PLease dear friends and seniors guide me on this i have been struggling on this from two days.

thanks
Marco Barenkamp
Ranch Hand

Joined: Aug 27, 2001
Posts: 94
Hi,

the questionmark must have an indexer.

Select Object(o) from customer o where o.name = ?1

?1 == first parameter
?2 == 2nd parameter

Rest looks fine.


Marco Barenkamp<br />_ _ _ _ _ ________________________ _ _ _ _ _ <br />L M I N T E R N E T S E R V I C E S AG<br /> <br />Head of Software Development<br /> <br /> <br />BEA Certified Enterprise Developer<br />Sun Certified Programmer for the Java2 Platform<br />Sun Certified Web Component Developer for the Java2 Platform<br />Sun Certified Developer for the Java 2 Platform <br />Sun Certified Business Component Developer for the Java 2 Platform <br />Sun Certified Enterprise Architect for the Java 2 Platform Enterprise Edition<br /> <br />LMIS AG
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cmp finder method
 
Similar Threads
Error compiling EJB-QL statement ''; FROM not found
CMP ejb-ql query
ejbSelect
Ejb-QL Problem
finder method of CMP thows NULLPOINTER EXCEPTION