Hi, I'm having a hard time with ejbSelect / XDoclet too, but I did figure out how to generate the ejbSelect itself though. You should do something like this:
| /** | * @ejb.select | * query="SELECT OBJECT(m.myField) FROM MyTable AS m WHERE ..." | */ | abstract public Integer ejbSelectMyField(...); | However, I want to use the ejbSelect to fetch the highest value of my primary key field in some table, so that I can calculate the next value for using in ejbCreate (which seems necessary because ejbCreate does not accept null for the primary key, although in the database I have an auto-incrementing int field). So I tried an EJB-QL query similar like this: | query="SELECT MAX(m.myPrimKey) FROM MyTable AS m" | However this goes wrong at deploy time, where JBoss reports an EJB-QL compile error since it does not understand the MAX() function. (apparently JBoss 3.2.3 is not CMP2.1 compliant where MAX() is defined). So I tried to use the jboss.query XDoclet tag, wich worked great for me with similar 'more advanced' queries on ejbFinder methods: | /** | * @ejb.select | * query="SELECT MAX(m.myPrimKey) FROM MyTable AS m" | * @jboss.query | * query="SELECT MAX(m.myPrimKey) FROM MyTable AS m" | */ | abstract public Integer ejbSelectMyPrimKey(); But this gives the same EJB-QL compile error; it seems the jboss.query tag is only applicable to ejbFinder and is ignored when used with ejbSelect methods. Possibly jboss.declared-sql must be used but I don't understand the XDoclet docs on this one. A working example indeed would be usefull. Anyone?? View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3833926#3833926 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3833926 ------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 _______________________________________________ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
