I'm trying to use a parameterized IN for a CMP bean, which I believe requires a
jboss-ql. According to some posts, I've learned that you should leave your ejb-ql
empty and write your query in the jboss-ql. But I get the following exception when I
deploy my ear file to jboss-3.2.5:
javax.management.MBeanException: org.jboss.deployment.DeploymentException: Error
compiling EJB-QL statement ''; - nested throwable:
(org.jboss.ejb.plugins.cmp.ejbql.ParseException: FROM not found)
Apparently it does not like the empty ejb-ql, but I thought this is how you do it.
Anyone know what I am doing wrong? Or what I am not doing right?
Thanks in advance,
Jason
Below are snippets from my ejb-jar.xml and jbosscmp-jdbc.xml files for my entity bean:
ejb-jar.xml
<display-name>Listing</display-name>
<ejb-name>Listing</ejb-name>
com.dtnet.service.database.entity.ListingHome
com.dtnet.service.database.entity.Listing
<ejb-class>com.dtnet.service.database.entity.ListingBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Long</prim-key-class>
False
<cmp-version>2.x</cmp-version>
<abstract-schema-name>Listing</abstract-schema-name>
<cmp-field><field-name>id</field-name></cmp-field>
<cmp-field><field-name>sellerId</field-name></cmp-field>
<cmp-field><field-name>categoryIdStr</field-name></cmp-field>
<cmp-field><field-name>title</field-name></cmp-field>
<cmp-field><field-name>zip</field-name></cmp-field>
<cmp-field><field-name>picture1</field-name></cmp-field>
<cmp-field><field-name>picture2</field-name></cmp-field>
<cmp-field><field-name>picture3</field-name></cmp-field>
<cmp-field><field-name>picture4</field-name></cmp-field>
<cmp-field><field-name>available</field-name></cmp-field>
<cmp-field><field-name>pending</field-name></cmp-field>
<cmp-field><field-name>sold</field-name></cmp-field>
<cmp-field><field-name>currPrice</field-name></cmp-field>
<primkey-field>id</primkey-field>
<query-method>
<method-name>findAvailable</method-name>
<method-params/>
</query-method>
<ejb-ql/>
<query-method>
<method-name>findByListingId</method-name>
<method-params>
<method-param>long</method-param>
</method-params>
</query-method>
<ejb-ql/>
<query-method>
<method-name>findByTitle</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql/>
<query-method>
<method-name>findByCategory</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql/>
<query-method>
<method-name>findByZip</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql/>
<query-method>
<method-name>findByCategoryAndZip</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql/>
jbosscmp-jdbc.xml
<ejb-name>Listing</ejb-name>
<table-name>listing</table-name>
<query-method>
<method-name>findAvailable</method-name>
<method-params/>
</query-method>
<jboss-ql>
<![CDATA[
SELECT OBJECT(a)
FROM Listing as a
WHERE a.available > 0
]]>
</jboss-ql>
<query-method>
<method-name>findByListingId</method-name>
<method-params>
<method-param>long</method-param>
</method-params>
</query-method>
<jboss-ql>
<![CDATA[
SELECT OBJECT(a)
FROM Listing as a
WHERE a.id = ?1
]]>
</jboss-ql>
<query-method>
<method-name>findByTitle</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<jboss-ql>
<![CDATA[
SELECT OBJECT(a)
FROM Listing as a
WHERE a.available > 0
AND a.title like ?1
]]>
</jboss-ql>
<query-method>
<method-name>findByCategory</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<jboss-ql>
<![CDATA[
SELECT OBJECT(a)
FROM Listing as a
WHERE a.available > 0
AND a.title like ?1
AND a.categoryIdStr in (?2)
]]>
</jboss-ql>
<query-method>
<method-name>findByZip</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<jboss-ql>
<![CDATA[
SELECT OBJECT(a)
FROM Listing as a
WHERE a.available > 0
AND a.title like ?1
AND a.zip in (?2)
]]>
</jboss-ql>
<query-method>
<method-name>findByCategoryAndZip</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<jboss-ql>
<![CDATA[
SELECT OBJECT(a)
FROM Listing as a
WHERE a.available > 0
AND a.title like ?1
AND a.categoryIdStr in (?2)
AND a.zip in (?3)
]]>
</jboss-ql>
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3849567#3849567
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3849567
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user