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>
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> "," ...