Hey,
i've been trying to get a dynamic query to work but when i deploy my package i get the error 'FROM not found' on a totally different class. I already found through google and this forum it points to the wrong class and i know the problem is in my dynamic query because without it, it deploys without any problem.
I use the following code:
/** * * Entitybean for StudentTable * * @ejb.bean name="Student" * display-name="Name for Student" * description="Description for Student" * jndi-name="ejb/Student" * type="CMP" * cmp-version="2.x" * view-type="local" * primkey-field="studentNumber" * * @jboss.query * dynamic = "true"; * signature = "java.util.Collection ejbSelectGeneral(java.lang.String query, java.lang.Object[] args)" */ public abstract class StudentBean implements EntityBean { // ... useuall stuff /** * @ejb.interface-method */ public abstract java.util.Collection ejbSelectGeneral(java.lang.String query, Object[] args) throws FinderException; /** * @ejb.home-method * view-type="local" */ public java.util.Collection ejbHomeSearchStudents(java.lang.String query, java.lang.Object[] args) throws FinderException { StringBuffer jbossQl = new StringBuffer(); jbossQl.append("SELECT OBJECT(l) "); jbossQl.append("FROM Student s, IN(s.labels) l "); jbossQl.append("WHERE "); jbossQl.append(query); return ejbSelectGeneral(jbossQl.toString(), args); } }
hmm after lots and lots of trouble i got it working... sort of...
it seems that generating the xdoclet via eclipse doesn't add the query to the jbosscmp-jdbc.xml. I added it manually and it works now.
Any idea what the answer to this problem could be?