On Thu, 2003-11-06 at 10:57, [EMAIL PROTECTED] wrote:
> I will give you an example of an 1 - N relation using XDoclet tags.
> Using this code you can easisly figure out what to put in your code:
> 
> Advertisement --1--------------------N-- Correction
> 
> AdvertisementBean.java:
>         /**
>          * @ejb.interface-method 
>          * @ejb.relation 
>          *              name = "Advertisement-Correction"
>          *              role-name = "AdvertisementHasCorrections"
>          *              cascade-delete = "no"
>          * @ejb.value-object
>          *              aggregate = 
> "nl.informatiefabriek.om.correction.value.CorrectionValue"
>          *              aggregate-name = "AllCorrection"
>          *              members = 
> "nl.informatiefabriek.om.correction.interfaces.CorrectionLocal"
>          *              members-name = "Corrections"
>          *              relation = "external"
>          *              type = "Collection"
>          * @jboss.relation-mapping style="foreign-key"
>          */
>         public abstract Collection getCorrections();
> 
> CorrectionBean.java:
> 
>         /**
>          * @ejb.interface-method 
>          * @ejb.relation 
>          *              name = "Advertisement-Correction"
>          *              role-name = "CorrectionBelongsToAdvertisement"
>          *              cascade-delete = "yes"
>          * @jboss.relation-mapping style = "foreign-key"
>          * @jboss.relation
>          *              fk-column="advertisement_fk"
>          *              related-pk-field="advertisementId"
>          */
>         public abstract AdvertisementLocal getAdvertisement();
> 
> 
> If you don't need relationships between value objects you can just leave 
> out he @ejb.value-object tags.

Hi,

Could you please show me what keys are you using on your relation? To
build a relationship you must have the same key on both sides of the
relation, right? If not, JBOSS throws an error.

Since I don't have it, I only could made a ejbSelect, but I don't know
what I'm losing on a select besides the CASCADE_DELETE. What is the
performance gain/loose of using relationship, select or a value-object?
What is value-object aggregation ?

thanks,
Pedro Salazar.
-- 
-PS



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to