I have seen that there is an open bug for many to many relations: http://jira.jboss.com/jira/browse/JBAS-1507
Maybe it is related to this one. Anyway, this is my ejb-jar.xml that could help: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'> <ejb-jar> <display-name>SoftiamEJBs</display-name> <enterprise-beans> <display-name>SessionControlEJB</display-name> <ejb-name>SessionControlEJB</ejb-name> softiam.services.ejbs.sessioncontrol.SessionControlHome softiam.services.ejbs.sessioncontrol.SessionControl <ejb-class>softiam.services.ejbs.sessioncontrol.SessionControlEJB</ejb-class> <session-type>Stateful</session-type> <transaction-type>Container</transaction-type> <ejb-name>ExperimentEJB</ejb-name> softiam.services.ejbs.experiment.ExperimentHome softiam.services.ejbs.experiment.Experiment <ejb-class>softiam.services.ejbs.experiment.ExperimentEJB</ejb-class> <abstract-schema-name>experiments</abstract-schema-name> <prim-key-class>java.lang.Long</prim-key-class> <primkey-field>experimentId</primkey-field> True <cmp-field> <field-name>experimentId</field-name> </cmp-field> <cmp-field> <field-name>user</field-name> </cmp-field> <cmp-field> <field-name>coupling</field-name> </cmp-field> <cmp-field> <field-name>state</field-name> </cmp-field> <cmp-field> <field-name>experimentIndex</field-name> </cmp-field> <cmp-field> <field-name>name</field-name> </cmp-field> <cmp-field> <field-name>description</field-name> </cmp-field> <cmp-field> <field-name>creationTime</field-name> </cmp-field> <cmp-field> <field-name>operationTime</field-name> </cmp-field> <query-method> <method-name>findExperiments</method-name> <method-params> <method-param>java.lang.String</method-param> </method-params> </query-method> <ejb-ql> SELECT OBJECT(e) FROM experiments e WHERE e.user=?1 </ejb-ql> <query-method> <method-name>findExperiments</method-name> <method-params> <method-param>java.lang.String</method-param> <method-param>java.lang.String</method-param> </method-params> </query-method> <ejb-ql> SELECT OBJECT(e) FROM experiments e WHERE e.user=?1 AND e.coupling=?2 </ejb-ql> <query-method> <method-name>findRunningExperiments</method-name> <method-params></method-params> </query-method> <ejb-ql> SELECT OBJECT(e) FROM experiments e WHERE e.state=1 </ejb-ql> <query-method> <method-name>findNotStartedExperiments</method-name> <method-params></method-params> </query-method> <ejb-ql> SELECT OBJECT(e) FROM experiments e WHERE e.state=0 </ejb-ql> <persistence-type>Container</persistence-type> <ejb-name>ConfigurationEJB</ejb-name> softiam.services.ejbs.configuration.ConfigurationHome softiam.services.ejbs.configuration.Configuration <ejb-class>softiam.services.ejbs.configuration.ConfigurationEJB</ejb-class> <abstract-schema-name>configurations</abstract-schema-name> <prim-key-class>softiam.services.ejbs.configuration.ConfigurationPK</prim-key-class> True <cmp-field> <field-name>experimentId</field-name> </cmp-field> <cmp-field> <field-name>coupling</field-name> </cmp-field> <cmp-field> <field-name>module</field-name> </cmp-field> <cmp-field> <field-name>parameter</field-name> </cmp-field> <cmp-field> <field-name>type</field-name> </cmp-field> <cmp-field> <field-name>singleValue</field-name> </cmp-field> <cmp-field> <field-name>rangeInitial</field-name> </cmp-field> <cmp-field> <field-name>rangeEnd</field-name> </cmp-field> <cmp-field> <field-name>rangeIncrement</field-name> </cmp-field> <cmp-field> <field-name>rangeCombine</field-name> </cmp-field> <cmp-field> <field-name>multipleValues</field-name> </cmp-field> <cmp-field> <field-name>multipleCombine</field-name> </cmp-field> <persistence-type>Container</persistence-type> </enterprise-beans> <ejb-relation> <ejb-relation-name>experiment-configuration</ejb-relation-name> <ejb-relationship-role> experiment <ejb-relationship-role-name>ExperimentRole</ejb-relationship-role-name> One <relationship-role-source> experiment <ejb-name>ExperimentEJB</ejb-name> </relationship-role-source> <cmr-field> configuration <cmr-field-name>configuration</cmr-field-name> <cmr-field-type>java.util.Collection</cmr-field-type> </cmr-field> </ejb-relationship-role> <ejb-relationship-role> configuration <ejb-relationship-role-name>ConfigurationRole</ejb-relationship-role-name> Many <cascade-delete /> <relationship-role-source> configuration <ejb-name>ConfigurationEJB</ejb-name> </relationship-role-source> </ejb-relationship-role> </ejb-relation> </ejb-jar> Many thanks, Santi View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984929#3984929 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984929 _______________________________________________ jboss-user mailing list [email protected] https://lists.jboss.org/mailman/listinfo/jboss-user
