0 Replies Latest reply on Aug 30, 2002 6:40 AM by hollfelder

    Problems with EJBQL

    hollfelder

      Hi to All,

      I have a problem with finder methods, respective their EJB-QL.

      I have defined:
      * @ejb:finder signature="Collection findBaureihenZuHersteller(short fabcode)" transaction-type="NotSupported"
      * query="SELECT Object(b) from Baureihe b where b.fabcode=?1"


      and when deploying get error:
      2002-08-30 11:37:39,807 ERROR [org.jboss.ejb.EjbModule] Starting failed
      org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "1" at line 1, column 50.
      Was expecting one of:
      <IDENTIFICATION_VARIABLE> ...
      <ENTITY_VALUED_PARAMETER> ...
      <ENTITY_VALUED_PATH> ...
      )
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.(JDBCEJBQLQuery.java:46)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createEJBQLQuery(JDBCCommandFactory.java:44)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.start(JDBCQueryManager.java:214)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:389)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:198)
      at org.jboss.ejb.EntityContainer.start(EntityContainer.java:376)
      at org.jboss.ejb.Container.invoke(Container.java:793)
      and so on.

      If I define:
      * @jboss:finder-query name="findBaureihenZuHersteller" query="fabcode={0}"

      everything's fine.
      What's wrong with the ejbql?? It works fine for finders without parameters but fails when the query contains parameters. Must I always define my queries via a @jboss:finder-query tag?

      Thanks,

      Thomas