Tom:

Thanks for the answer, but I am still confused- when you say to specify the inverse foreign key, do you mean to use the remote-foreignkey attribute? This doesn't make sense to me because the parent and children collection is explict and I get this error:

--------
[ojbdoclet] Caused by: xdoclet.XDocletException: The remote-foreignkey property specified for collection children in class com.alphatech.ebo.datamodels.SimpleDAGNode
doesn't match the foreignkey property of the corresponding collection children in class com.alphatech.ebo.datamodels.SimpleDAGNode
--------


Here is my java code:

-------------------------
public class SimpleDAGNode{

/**
* @ojb.collection element-class-ref="com.alphatech.ebo.datamodels.SimpleDAGNode"
* auto-retrieve="true"
* auto-update="true"
* auto-delete="true"
* indirection-table="parent_children_table"
* foreignkey="parent_id"
* remote-foreignkey="child_id"
*
*/
protected List children;


  /**
   * @ojb.field primarykey="true"
   * column="ebo_id"
   * jdbc-type="VARCHAR"
   * length="35"
   */
  protected String ID;

/**
* @ojb.collection element-class-ref="com.alphatech.ebo.datamodels.SimpleDAGNode"
* auto-retrieve="true"
* auto-update="true"
* auto-delete="true"
* indirection-table="parent_children_table"
* foreignkey="child_id"
* remote-foreignkey="parent_id"
*
*/
protected List parents;
-------------------------


thanks,
Brad

Well, its not exactly a bug. Since you didn't specify an inverse foreign
key, the XDoclet module will use the foreignkey of the first collection in
the element class that specifies the same indirection table. Only it
currently won't check whether thats the same collection (which I'll fix).

However I think in your case you should specify the inverse foreignkey
anyway. If (for whatever reason) you decide to add a third collection
right that points to the same class (e.g. neighbors) at the beginning of
the class then you will get the same problem again.

Tom


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to