I'm having an issue with defining a CMR on an object that has children/parents of itself
 
ie, table form:
 
 node_id(tsn),  node_name, parent_node_id (parent_tsn)
 
/**
    * @ejb.interface-method
    * @ejb.relation
    *   name="node-has-children"
    *   role-name="node"
    *   target-ejb="Unit"
    *   target-role-name="children"
    *
    * @jboss.target-relation
    *   related-pk-field="tsn"
    *   fk-column="parent_tsn"
    *
    * @ejb.relation
    *    name="node-has-children"
    *    role-name="children"
    *
     * @ejb.value-object
     *    aggregate="com.foo.UnitValue"
     *    aggregate-name="ChildNode"
     *    members="com.foo.UnitLocal"
     *    members-name="UnitValue"
     *    relation="external"
     *    type="Collection"
     */
 
  Is this the correct way to do this?  It works.. but it works too well.   Once it loads the children for the object, it continues to load the children for each of those children, and then the children of all of those children... until it runs out of data.
  
  Is the value object the problem?  I'm using aggregate rather than compose, as the objects aren't responsible for creating each other (this is a static table).
 
Is this a factor of the way I've defined my relationship, or an issue with CMR or my app server? (I'm using JBoss 3.0.6).  Is there a tag I can add to control the read depth?  I've tried using the read-ahead strategy tag, but that doesn't seem to do anything (even when I set it to "none").  
 
I'm sorry if this isn't the right place.. just checking all possibilities (I've posted on the java forums, too).
 
Thanks for all help!
 
 

Reply via email to