Title: SV: CMP 2.0 OR mapping problem

Please remember that the EJB 2.0 spec is not yet released.
Although the Orion Team has always be known to be fast to implement early specifications,
this is a costly arrangement as specifications change.

Personally I hope that EJB 2.0 relations will soon be fully implemented.
WR

> -----Ursprungligt meddelande-----
> Från: Michael A Third [mailto:[EMAIL PROTECTED]]
> Skickat: den 23 februari 2001 06:15
> Till: Orion-Interest
> Ämne: RE: CMP 2.0 OR mapping problem
>
>
>
> Thanks for the reply.  We were already doing this, and I realized how
> repetitive it was and hoped that 1.4.7 could cut the time we
> spent doing
> this (we have a lot of these relationships).  Does anyone
> have a guess as to
> when full EJB 2.0 support will be available?
>
> Thanks,
>
> Michael
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Jeff Schnitzer
> Sent: Thursday, February 22, 2001 8:18 PM
> To: Orion-Interest
> Subject: RE: CMP 2.0 OR mapping problem
>
>
> Bidirectional relationships do not yet work.
>
> There are two workarounds that have worked for me:
>
> Manually add (and remove!) both sides of the relationship.  So your
> Marketplace.addStorefront() method would look like this:
>
> void addStorefront(Storefront front)
> {
>       this.getStorefronts().add(front);
>
> front.setMarketplace((Marketplace)this.ejbContext.getEJBObject());
> }
>
> etc.  Alternatively you can modify your
> Marketplace.getMarketplaceStorefronts() method so that instead of
> obtaining the storefronts from the internal collection it runs a
> findByMarketplace finder method on the StorefrontHome.  Then you just
> need to make sure that the storefronts->marketplace reference is kept
> solid.
>
> Jeff
>
> >-----Original Message-----
> >From: Michael A Third [mailto:[EMAIL PROTECTED]]
> >Sent: Thursday, February 22, 2001 3:37 PM
> >To: Orion-Interest
> >Subject: CMP 2.0 OR mapping problem
> >
> >
> >I have been trying to get Orion to correctly map a non-dependant
> >bidirectional 1:N relationship using EJB 2.0.  It tries to generate a
> >collection mapping that uses a third table to hold the
> >reference.  I was
> >able to deploy it properly using a unidirectional relationship.
> >
> >Here is the relevant entries from ejb-jar.xml (edited for brevity):
> >             <entity>
> >
> ><ejb-name>com.trademotion.ejb.base.Marketplace</ejb-name>
> >
> ><cmp-field><field-name>marketplaceID</field-name></cmp-field>
> >
> ><cmp-field><field-name>name</field-name></cmp-field>
> >
> ><cmp-field><field-name>storefronts</field-name></cmp-field>
> >                     <primkey-field>marketplaceID</primkey-field>
> >             </entity>
> >             <entity>
> >
> ><ejb-name>com.trademotion.ejb.base.Storefront</ejb-name>
> >
> ><cmp-field><field-name>storefrontID</field-name></cmp-field>
> >
> ><cmp-field><field-name>name</field-name></cmp-field>
> >
> ><cmp-field><field-name>marketplace</field-name></cmp-field>
> >                     <primkey-field>storefrontID</primkey-field>
> >             </entity>
> >
> >     <relationships>
> >             <!-- 1:N (Marketplace Storefront) -->
> >             <ejb-relation>
> >
> ><ejb-relation-name>Marketplace-Storefront</ejb-relation-name>
> >
> >                     <ejb-relationship-role>
> >
> ><ejb-relationship-role-name>marketplace-has-storefronts
> >                             </ejb-relationship-role-name>
> >                             <multiplicity>One</multiplicity>
> >                             <role-source>
> >
> ><ejb-name>com.trademotion.ejb.base.Marketplace</ejb-name>
> >                             </role-source>
> >                             <cmr-field>
> >
> ><cmr-field-name>storefronts</cmr-field-name>
> >
> ><cmr-field-type>java.util.Collection</cmr-field-type>
> >                             </cmr-field>
> >                     </ejb-relationship-role>
> >
> >                     <ejb-relationship-role>
> >
> ><ejb-relationship-role-name>storefront-belongsto-marketplace
> >                             </ejb-relationship-role-name>
> >                             <multiplicity>Many</multiplicity>
> >                             <cascade-delete/>
> >                             <role-source>
> >
> ><ejb-name>com.trademotion.ejb.base.Storefront</ejb-name>
> >                             </role-source>
> >                             <cmr-field>
> >
> ><cmr-field-name>marketplace</cmr-field-name>
> >
> ><cmr-field-type>com.trademotion.ejb.base.Marketplace
> >                                     </cmr-field-type>
> >                             </cmr-field>
> >                     </ejb-relationship-role>
> >             </ejb-relation>
> >
> >     </relationships>
> >Here is the generated orion-ejb-jar.xml (again, edited):
> >             <entity-deployment
> >name="com.trademotion.ejb.base.Marketplace">
> >                     <primkey-mapping>
> >                             <cmp-field-mapping
> >name="marketplaceID" persistence-
> >                                     name="marketplaceID" />
> >                     </primkey-mapping>
> >                     <cmp-field-mapping name="storefronts">
> >                             <collection-mapping
> >
> >table="com_trademotion_ejb_base_Marketplace_storefronts">
> >                                     <primkey-mapping>
> >
> ><cmp-field-mapping name="marketplaceID" persistence-
> >
> >name="marketplaceID" />
> >                                     </primkey-mapping>
> >                                     <value-mapping
> >type="com.trademotion.ejb.base.Storefront">
> >
> ><cmp-field-mapping name="value">
> >                                                     <entity-ref
> >
> >home="com.trademotion.ejb.base.Storefront">
> >
> ><cmp-field-mapping name="value"
> >                                             persistence-name="value"
> >/>
> >                                                     </entity-ref>
> >                                             </cmp-field-mapping>
> >                                     </value-mapping>
> >                             </collection-mapping>
> >                     </cmp-field-mapping>
> >             </entity-deployment>
> >
> >The Storefront side of relationship is generated correctly.
> >From previous
> >posts, Orion supports what I'm trying to do (btw, I'm using 1.4.7).
> >
> >Thanks,
> >
> >Michael A Third
> >Parts.com
> >
> >-----Original Message-----
> >From: [EMAIL PROTECTED]
> >[mailto:[EMAIL PROTECTED]]On Behalf Of
> >Robert Krueger
> >Sent: Thursday, February 22, 2001 1:44 PM
> >To: Orion-Interest
> >Subject: RE: No influence on CMP 2.0 getter setter methods -
> a feature
> >or abug?
> >
> >
> >
> >>
> >>There seems to be some smart-ass named "Robert Krueger"
> >>who thinks he knows all the answers :) :) :)
> >
> >I've heard of him. he must be a real pain in the ass ;).
> >
> >cheers,
> >
> >robert
> >
> >>Thanks Robert!
> >>
> >>-tim
> >
> >(-) Robert Krüger
> >(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
> >(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
> >(-) Tel: 06151 665401, Fax: 06151 665373
> >(-) [EMAIL PROTECTED], www.signal7.de
> >
> >
> >
>
>

Reply via email to