Hello,
I've tried
several different combinations of tags to generate a many to 1 unidirectional
relationship, but can't get
it.
Say I have a two beans, a PackageBean and a
PostalDepotBean, and many packages can belong to one Depot. So I want
the PackageBean to know which DepotBean it belongs to but don't want the
DepotBean to know which packages belong to it.
The following
is what I curently have as the
relationship declaration in the PackageBean
/**
* @return the postal depot for this package
* @ejb:interface-method view-type="local"
* @ejb:relation
* name="package-postalDepot"
* role-name="one-package-belongs-to-one-postalDepot "
* target-role-name="one-postalDepot-has-many-packages"
* target-ejb="PostalDepot"
* target-multiple="yes"
*
* @weblogic:column-map
* foreign-key-column="POSTAL_DEPOT_KEY"
* key-column="POSTAL_DEPOT_KEY"
*/
public abstract PostalDepotLocal getPostalDepot();
/**
* @param postalDepot the postal depot for this package
* @ejb:interface-method view-type="local"
*/
public abstract void setPostalDepot(PostalDepotLocal postalDepot);
* @return the postal depot for this package
* @ejb:interface-method view-type="local"
* @ejb:relation
* name="package-postalDepot"
* role-name="one-package-belongs-to-one-postalDepot "
* target-role-name="one-postalDepot-has-many-packages"
* target-ejb="PostalDepot"
* target-multiple="yes"
*
* @weblogic:column-map
* foreign-key-column="POSTAL_DEPOT_KEY"
* key-column="POSTAL_DEPOT_KEY"
*/
public abstract PostalDepotLocal getPostalDepot();
/**
* @param postalDepot the postal depot for this package
* @ejb:interface-method view-type="local"
*/
public abstract void setPostalDepot(PostalDepotLocal postalDepot);
POSTAL_DEPOT_KEY is the primary key of the
PostalDepotBean.
This does not work
as xdoclet complains that I need a primary key column called POSTAL_DEPOT_KEY in
the PackageBean.
How do I define the
PackageBean as the 'many' side of the relationship?
Thanks
Simon Hall mob: 077 4877 2134
