Finder method problems in the Deploy stage.
hooligan495 Oct 2, 2002 5:03 PMHello,
I am trying to learn EJB CMP 2.0 and Jboss at the same time. I've been doing a lot of reading and I am now at a point where I need to ask for some help. I have a Results table in a database. I am trying to create a CMP Bean to access this table. When I get to the deploy stage I get the following Exception:
org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.UnknownPathException: Unknown terminal field: at line 1, column 58. Encountered: "tastingid" after: "s.")
at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.(JDBCEJBQLQuery.java:46)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createEJBQLQuery(JDBCCommandFactory.java:44)
Here is an excerpt from my ejb.java file:
/**
* This is the EJB definition for the Tasting Results Bean. Each bean is associated with a
* wine a tasting and a score.
*
* @author jmcgaffigan
*
* ----- Below are the XDoclet tags used by Ant's EJB Doclet task to create
* ----- the various components of an EJB for deployment.
* @ejb:bean name="wine/ResultsEJB"
* display-name="A collection of results"
* type="CMP"
* local-jndi-name="ejb/wine/ResultsEJB"
* reentrant="false"
* cmp-version="2.x"
* view-type="local"
* schema="ResultsSchema"
*
* @ejb:env-entry name="SequenceName"
* value="ResultsEJB"
*
* @ejb:ejb-ref ejb-name="wine/SequenceGenerator"
*
* @ejb:transaction type="Required"
*
* @ejb:finder signature="java.util.Collection findAll()"
* @ejb:finder signature="java.util.Collection findByScorer(java.lang.String scorer)"
* query="SELECT OBJECT(s) FROM ResultsSchema AS s WHERE s.comment=?1"
* @ejb:finder signature="java.util.Collection findByTasting(long tasting)"
* query="SELECT OBJECT(s) FROM ResultsSchema AS s WHERE s.tastingid = ?1"
*
* @jboss:table-name table-name="tastingresults"
* @jboss:create-table create="true"
* @jboss:remove-table remove="false"
*/
If I remove the finder for FindByTasting things compile deploy and everything is happy. The tastingid finder I am trying to build is keyed off an Integer(I've also tried long and int) and not a String. It seems that I can make finders that search based on String types but nothing else. Am I doing something wrong? or is there something about ejbql and jboss that isn't complete yet? I've read teh quick start manual, bought the jboss 3.0 pdf, am reading a couple of EJB books. But I can't seem to find the magic words that will tell me what's wrong.
Any advice I can get would be most excellent.
Jay