|
Hello.
I’ve been trying to get the following select method code to work in an EJB I call Product:
/** * @ejb.select * signature="java.util.Collection ejbSelectNameMatch(String nameMatch)" * query="SELECT OBJECT(p) FROM Product p WHERE p.name LIKE ?1" * @ejb.transaction type="Supports" */ public abstract java.util.Collection ejbSelectNameMatch(String nameMatch) throws FinderException; /** * @ejb.home-method */ public java.util.Collection ejbHomeSelectByNameMatch(String nameMatch) { java.util.Collection productList = null; try { productList = ejbSelectNameMatch(nameMatch); } catch (FinderException e) {} return productList; } // ejbHomeSelectByNameMatch
However, when I deploy it to a JBoss 3.2.3 server it fails to compile the EJB-QL, stopping on the LIKE ?1 portion of the EJB-QL. Here is the exact error message:
Error compiling EJB-QL statement 'SELECT OBJECT(p) FROM Product p WHERE p.name LIKE ?1'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "1" at line 1, column 51. Was expecting: <STRING_LITERAL> ... )]
The odd thing is that I have finder methods using the same syntax which compile and work fine. The only difference between the finder and select method that I’ve noticed is that I can supply an SQL-specific query to override the otherwise generated query for the finder methods. I have not yet found a way to do the same for the select methods. Is this possible?
Does anybody have any suggestions on what to do here?
Patrick |
- Re: [Xdoclet-user] @ejb.select problems with JBoss Patrick Bakker
- Re: [Xdoclet-user] @ejb.select problems with JBoss Andrew Stevens
- RE: [Xdoclet-user] @ejb.select problems with JBoss Harkness, David
- RE: [Xdoclet-user] @ejb.select problems with JBoss COCKLE Timothy
- RE: [Xdoclet-user] @ejb.select problems with JBoss Patrick Bakker
- RE: [Xdoclet-user] @ejb.select problems with JBoss Patrick Bakker
