I have set up a 1-1 unidirectional relationship just like the xPetstore, but it does not seem to work at all. I don't get errors, but the relationship does not update. I have a MedicalHistoryDto that has an AllergiesDto. I can populate the Allergies by itself like a standalone bean, but not like medicalHistoryDto.setAllergiesDto( allergiesDto );

My Code:
=========================
   /**
    * Get Allergies for this medicalHistory.
    *
    * @ejb.interface-method
    *
    * @ejb.relation
    *      name="MedicalHistory-Allergies"
    *      role-name="medical_history-has-allergies"
    *      target-ejb="Allergies"
    *      target-role-name="allergies-belongs_to-medical_history"
    *      target-cascade-delete="yes"
    *
    * @ejb.value-object
    *      compose="com.baselogic.yoursos.user.AllergiesDto"
    *      compose-name="AllergiesDto"
    *      members="com.baselogic.yoursos.user.AllergiesLocal"
    *      members-name="AllergiesDto"
    *      relation="external"
    *
    * @jboss.relation
    *      fk-column="allergies_id_fk"
    *      related-pk-field="medicalHistoryId"
    *      fk-contraint="true"
    */
   public abstract AllergiesLocal getAllergies();
   public abstract void setAllergies( AllergiesLocal pAllergiesLocal );




/** * Retrieve the MedicalHistory's ID. * * @ejb.pk-field * @ejb.persistent-field * @ejb.interface-method * @ejb.transaction * type="NotSupported" * @jboss.column-name name="medical_history_id" **/ public abstract java.lang.String getMedicalHistoryId();

/**
* No interface method for setMedicalHistoryId(..). See page 130 of the EJB 2.0 specification:
* "Once the primary key for an entity bean has been set, the Bean Provider must
* not attempt to change it by use of set accessor methods on the primary key
* cmp-fields. The Bean provider should therefore not expose the set accessor
* methods for the primary key cmp-fields in the component interface of the
* entity bean.". A work around would be to remove and then an re-create the bean.
*/
public abstract void setMedicalHistoryId( java.lang.String pMedicalHistoryId );





--- Thanks... Mick Knutson ---

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail




-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to