-
1. Re: newbie: finder method in ejb-jar is ignored by jboss
pdelgado0 Apr 15, 2003 1:09 PM (in response to smilidon)Hi, it'd be much easier if you post here the ejb-jar.xml lines refering finder method that doesn't work.
I have the following in my ejb-jar.xml and it works ...
......
......
<query-method>
<method-name>findTokens</method-name>
<method-params>
<method-param>java.lang.Long</method-param>
<method-param>java.lang.Long</method-param>
</method-params>
</query-method>
<ejb-ql>[CDATA[SELECT OBJECT(h) FROM Token h WHERE h.tokenprovider.idtokenprovider = ?1 AND h.idtokentype = ?2]]</ejb-ql>
.....
.....
Note. These lines are generated by xdoclet.
I hope this may help you.
Pablo -
2. Re: newbie: finder method in ejb-jar is ignored by jboss
smilidon Apr 16, 2003 3:36 AM (in response to smilidon)my ejb-jar.xml:
<?xml version="1.0"?>
<ejb-jar>
<enterprise-beans>
<ejb-name>E_Emotion</ejb-name>
ejb.interfaces.E_EmotionHome
ejb.interfaces.E_EmotionRemote
<ejb-class>ejb.bean.E_EmotionBean</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>E_Emotion</abstract-schema-name>
<cmp-field>
<field-name>e_id</field-name>
</cmp-field>
<cmp-field>
<field-name>e_bez</field-name>
</cmp-field>
<primkey-field>e_id</primkey-field>
<query-method>
<method-name>findEmotion</method-name>
<method-params>
<method-param>Integer</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT o FROM E_Emotion o WHERE e_id = ?1]]>
</ejb-ql>
</enterprise-beans>
</ejb-jar>
maybe there is something i must declare first? must i use jbosscmp-jdbc.xml, or jboss.xml or is it optional? -
3. Re: newbie: finder method in ejb-jar is ignored by jboss
smilidon Apr 16, 2003 3:43 AM (in response to smilidon)where is my posting? ok, once again:
thanks for your reply...
my ejb-jar.xml:
<?xml version="1.0"?>
<ejb-jar>
<enterprise-beans>
<ejb-name>E_Emotion</ejb-name>
ejb.interfaces.E_EmotionHome
ejb.interfaces.E_EmotionRemote
<ejb-class>ejb.bean.E_EmotionBean</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>E_Emotion</abstract-schema-name>
<cmp-field>
<field-name>e_id</field-name>
</cmp-field>
<cmp-field>
<field-name>e_bez</field-name>
</cmp-field>
<primkey-field>e_id</primkey-field>
<query-method>
<method-name>findEmotion</method-name>
<method-params>
<method-param>Integer</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT o FROM E_Emotion o WHERE e_id = ?1]]>
</ejb-ql>
</enterprise-beans>
</ejb-jar>
i dont see any mistake. if something wrong, jboss should throw an exception?! must i declare something first? must i use jbosscmp-jdbc.xml or jboss.xml? is there a good documentation how to use cmp with jboss (maybe for free)?
regards -
4. Re: newbie: finder method in ejb-jar is ignored by jboss
smilidon Apr 16, 2003 3:44 AM (in response to smilidon)where is my posting? ok, once again:
thanks for your reply...
my ejb-jar.xml:
<?xml version="1.0"?>
<ejb-jar>
<enterprise-beans>
<ejb-name>E_Emotion</ejb-name>
ejb.interfaces.E_EmotionHome
ejb.interfaces.E_EmotionRemote
<ejb-class>ejb.bean.E_EmotionBean</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>E_Emotion</abstract-schema-name>
<cmp-field>
<field-name>e_id</field-name>
</cmp-field>
<cmp-field>
<field-name>e_bez</field-name>
</cmp-field>
<primkey-field>e_id</primkey-field>
<query-method>
<method-name>findEmotion</method-name>
<method-params>
<method-param>Integer</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT o FROM E_Emotion o WHERE e_id = ?1]]>
</ejb-ql>
</enterprise-beans>
</ejb-jar>
i dont see any mistake. if something wrong, jboss should throw an exception?! must i declare something first? must i use jbosscmp-jdbc.xml or jboss.xml? is there a good documentation how to use cmp with jboss (maybe for free)?
regards -
5. Re: newbie: finder method in ejb-jar is ignored by jboss
ali-gator Apr 16, 2003 4:57 AM (in response to smilidon)Your EJB-QL command is wrong. You must have:
SELECT OBJECT(o) FROM E_Emotion o WHERE e_id = ?1
Hope it'll help you. -
6. Re: newbie: finder method in ejb-jar is ignored by jboss
pdelgado0 Apr 16, 2003 11:28 AM (in response to smilidon)Try this EJB-QL query ...
.......
.......
<query-method>
<method-name>findEmotion</method-name>
<method-params>
<method-param>java.Lang.Integer</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(o) FROM E_Emotion o WHERE o.e_id = ?1]]>
</ejb-ql>
.....
..... -
7. Re: newbie: finder method in ejb-jar is ignored by jboss
smilidon Apr 17, 2003 5:31 AM (in response to smilidon)Thanks for your help. It seems the finder method is called but i get an exception ObjectNotFoundException: No such entity!
But I know that I have an entity with e_id=1, i'm looking for... i call my finder like this:
home.findEmotion(new Integer(1))
please help again