Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

cmp finder method

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic