Well, as I have been frustrated trying to get this to work, I switched this to a 1-1 bi-directional relationship. But I still can't get this to work. I really don't know why, because I have another 1-M bi-directional that seems to work fine.
I can't use the finder as there is _not_ a cmp attribute on Allergies anymore.


Here is what I have now:
===============

MedicalHistoryBean:
=============================
   /**
    * 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 );


AllergiesBean:
=============================
/**
* Get the MedicalHistory for this Allergies
*
* @ejb.interface-method
*
* @ejb.relation
* name="MedicalHistory-Allergies"
* role-name="allergies-belongs_to-medical_history"
* target-ejb="Allergies"
*
* @jboss.relation
* fk-column="medical_history_id_fk"
* related-pk-field="medicalHistoryId"
* fk-contraint="true"
**/
public abstract MedicalHistoryLocal getMedicalHistory();
public abstract void setMedicalHistory( MedicalHistoryLocal pMedicalHistory );



ALLERGIES_TABLE: ============= allergies_id: varchar medical_history_id_fk: varchar ......more attributes...

MEDICAL_HISTORY_TABLE:
==================
medical_history_id: varchar
user_id_fk: bigint




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





From: "Ingo Bruell" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: AW: [Xdoclet-user] 1-1 unidirectional relationship issue
Date: Fri, 27 Jun 2003 14:02:42 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Mick,

> I am still having an issue here.
> I have now been working on this for about 3 solid days now. Please help!
>
> I get the Allergies created as well as the MedicalHistory object in the DB,
> but the Allergies does not have a medical_history_id_fk so I have no way to
> find that Allergies from the Medical HistoryID.


You need a finder to get it, something like:

@ejb.finder signature="..."
            query="SELECT OBJECT(o) FROM Allergies as o WHERE
o.medicalHistory.id = ?1"


best regards


Ingo Bruell

- - ---
<[EMAIL PROTECTED]>
<ICQ# 40377720>
Oldenburg PGP-Fingerprint: CB01 AE12 B359 87C4 BF1C 953C 8FE7 C648 169E E5FC
Germany PGP-Public-Key available at pgpkeys.mit.edu


-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>

iQA/AwUBPvwj/4/nxkgWnuX8EQJYlwCgkeSuc/FprhKdGRAij9N5BQ9BwekAn1/V
ylVTbXZab7UQNq0MP9YLFnWp
=tijH
-----END PGP SIGNATURE-----




------------------------------------------------------- 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

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus




-------------------------------------------------------
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