2 Replies Latest reply on Sep 12, 2002 2:25 AM by cosmic_crusader

    EJBQL cannot select single field?

    cosmic_crusader

      G'Day,

      When I attempt the following EJBQL:

      <query-method>
      <method-name>ejbSelectCargoValue</method-name>
      <method-params>
      <method-param>packet.interfaces.PacketEntityLocal</method-param>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>[CDATA[SELECT c.value FROM PacketEntity p, IN (p.cargoes) AS c WHERE p = ?1 AND c.name = ?2]]</ejb-ql>


      I get the following exception:
      org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested throwable: (java.lang.IllegalStateException: Can not visit multi-column path node. Should have been handled at a higher level.)
      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.startStoreManager(JDBCStoreManager.java:463)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:369)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:198)

      I'm trying to do it this way so that an EntityBean reference isn't created (by an OBJECT() call).
      Wouldn't retrieving a single field like this be better than that? (And hence my reason for asking).

      Thanks in advance for any help.