Finder Methods
jacktr Apr 15, 2002 11:07 AMhi
i'm using jboss3.0 beta and oracle8. My problem is: i'm trying to implement a finder method, my remote home interface looks like this:
public interface LastGivenUuidNrHome extends EJBHome
{
public LastGivenUuidNr create(Integer uuid)
throws RemoteException, CreateException;
public LastGivenUuidNr findByPrimaryKey(Integer primaryKey)
throws RemoteException, FinderException;
public Integer findByBiggest()
throws RemoteException, FinderException;
}
in the ejb-jar.xml i wrote the sql query like this:
//..
LastGivenUuidNr Entity Bean
<display-name>LastGivenUuidNr Bean</display-name>
<ejb-name>LastGivenUuidNrBean</ejb-name>
LastGivenUuidNr.LastGivenUuidNrHome
LastGivenUuidNr.LastGivenUuidNr
<ejb-class>LastGivenUuidNr.LastGivenUuidNrEJB</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
False
<cmp-version>2.x</cmp-version>
<abstract-schema-name>Lgun</abstract-schema-name>
<cmp-field><field-name>uuid</field-name></cmp-field>
<cmp-field><field-name>id</field-name></cmp-field>
<primkey-field>uuid</primkey-field>
<security-identity><use-caller-identity/></security-identity>
<query-method>
<method-name>findByBiggest</method-name>
<method-params/>
</query-method>
<ejb-ql>
SELECT OBJECT(l) FROM Lgun l
WHERE l.uuid = (SELECT MAX(l.uuid) FROM lgun l)
</ejb-ql>
..//
and i get the following error
2002-04-15 17:04:15,550 INFO [org.jboss.ejb.EJBDeployer] Deploying ArchiveBean
2002-04-15 17:04:15,570 INFO [org.jboss.ejb.EJBDeployer] Deploying ContentUnitBean
2002-04-15 17:04:15,580 INFO [org.jboss.ejb.EJBDeployer] Deploying DocumentBean
2002-04-15 17:04:15,580 INFO [org.jboss.ejb.EJBDeployer] Deploying AllComponentsBean
2002-04-15 17:04:15,580 INFO [org.jboss.ejb.EJBDeployer] Deploying CU_DocumentBean
2002-04-15 17:04:15,590 INFO [org.jboss.ejb.EJBDeployer] Deploying LastGivenUuidNrBean
2002-04-15 17:04:15,590 INFO [org.jboss.ejb.EJBDeployer] Deploying NeuesDocAnlegenBean
2002-04-15 17:04:16,241 ERROR [org.jboss.ejb.EntityContainer] Exception in service lifecyle operation: start
org.jboss.deployment.DeploymentException: Unable to parse EJB-QL:
SELECT OBJECT(l) FROM Lgun l
WHERE l.uuid = (SELECT MAX(l.uuid) FROM lgun l)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.(JDBCEJBQLQuery.java:51)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createEJBQLQuery(JDBCCommandFactory.java:44)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.start(JDBCQueryManager.java:177)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:335)
at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:175)
at org.jboss.ejb.EntityContainer.start(EntityContainer.java:368)
at org.jboss.ejb.Container.invoke(Container.java:749)
at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:995)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:777)
at $Proxy2.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:341)
at java.lang.reflect.Method.invoke(Native Method)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:78)
at $Proxy1.start(Unknown Source)
at org.jboss.ejb.Application.start(Application.java:265)
at org.jboss.ejb.EJBDeployer.deploy(EJBDeployer.java:459)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:458)
at org.jboss.deployment.MainDeployer.scan(MainDeployer.java:296)
at org.jboss.deployment.MainDeployer.run(MainDeployer.java:259)
at java.lang.Thread.run(Unknown Source)
could someone help me?