Hello All,
I have a requirement such that the finder method in an CMP entity bean should return 10
Entities from the specified starting position from the specified topic. How write ejb-ql
query to retrive the required information?
I have used the following statement as my ejb-ql query
<ejb-ql>select object(o) from post as o where o.topicId = ?1 order by o.topicId desc
offset ?2 limit 10</ejb-ql>
But using that resulted in following error.
10:06:05,639 ERROR [postEntity#findByTopicId] Encountered "offset" at line 1,
column 78.
| Was expecting one of:
| <EOF>
| "," ...
|
| org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "offset" at line
1, column 78.
| Was expecting one of:
| <EOF>
| "," ...
|
| 10:06:05,639 WARN [ServiceController] Problem starting service
jboss.j2ee:service=EjbModule,module=forum.jar
| org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement for EJB
'postEntity': select object(o) from post as o where o.topicId = ?1 order by
o.topicId desc offset ?2 limit 10; - nested throwable:
(org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "offset" at line 1,
column 78.
| Was expecting one of:
| <EOF>
| "," ...
| )
| Caused by: org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered
"offset" at line 1, column 78.
| Was expecting one of:
| <EOF>
| "," ...
I'm using JBoss 4.0.5 and CMP 2.0
Please help me in solving this error.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009845#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...