I have tone CMP Bean whis relationship to itself.
<ejb-name>Nodes</ejb-name>
<table-name>Nodes</table-name>
<cmp-field>
<field-name>nodeID</field-name>
<column-name>nodeID</column-name>
</cmp-field>
<cmp-field>
<field-name>parentID</field-name>
<column-name>parentID</column-name>
</cmp-field>
--------------------------------
and relatinship
one to many.
ejb-jar.xml:
<ejb-relation>
<ejb-relation-name>nodes-nodes</ejb-relation-name>
<ejb-relationship-role>
nodes
<ejb-relationship-role-name>NodesRelationshipRole</ejb-relationship-role-name>
One
<relationship-role-source>
nodes
<ejb-name>Nodes</ejb-name>
</relationship-role-source>
<cmr-field>
nodes
<cmr-field-name>nodes</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
nodes
<ejb-relationship-role-name>NodesRelationshipRole1</ejb-relationship-role-name>
Many
<relationship-role-source>
nodes
<ejb-name>Nodes</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
--------------------------------------
and jbosscmp-jdbc.xml:
<ejb-relation>
<ejb-relation-name>nodes-nodes</ejb-relation-name>
<foreign-key-mapping />
<ejb-relationship-role>
<ejb-relationship-role-name>NodesRelationshipRole</ejb-relationship-role-name>
<key-fields>
<key-field>
<field-name>nodeID</field-name>
<column-name>parentID</column-name>
</key-field>
</key-fields>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>NodesRelationshipRole1</ejb-relationship-role-name>
</ejb-relationship-role>
</ejb-relation>
-----------------------------
when I next mesods:
Nodes nodes = nodesHome.findByPrimaryKey(new Long(1));
Collection collection = nodes.getNodes();
Iterator iterator = collection.iterator();
iterator.getNaxt();
iterator.remove();
I see,that forein key field that coresponding to the records that i remove,set to null
value, but i don't do "nodes.setNodes(collection).
Is't normall behavior for Jboss3.2.3?
<a
href="http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3825391#3825391">View
the original post</a>
<a
href="http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3825391>Reply
to the post</a>
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user