|
hi everyone, i have
scoured the list for the last two days.....and thought i
was close to setting a 1:m CMR but now i am
stuck..... the cmr field is never populated and seems that ejbPostCreate doesnt get called. could someone please help me here.... ******************BundleEJB********************************************* ** * @ejb:interface-method
view-type="both" */ public
abstract void setProjectID(Integer projectID); /** * @ejb.interface-method * view-type="local" * * * * @ejb:relation name="bundle-properties" * role-name="bundle-has-properties" * target-ejb="PropertyEJB" * * @jboss:target-relation fk-constraint="true" * related-pk-field="entityID"
* fk-column="bundle_id_fk" */ public
abstract java.util.Collection getPropertiesInBundle(); /** * * @ejb:interface-method
view-type="both" */ public
abstract void setPropertiesInBundle(Collection propertiesInBundle); **********************PropertyEJB************************************** /** * @ejb:interface-method
view-type="both" * * * * @ejb:relation name="bundle-properties" * role-name="properties-belongto-bundle" * target-ejb="BundleEJB" * target-multiple="yes" * * @jboss:relation fk-constraint="true" * related-pk-field="entityID"
* fk-column="bundle_id_fk" * * */ public
abstract BundleEJBLocal getBundle(); /** * @ejb:interface-method
view-type="both" * */ public
abstract void setBundle(BundleEJBLocal
bundleLocal); /** * Create Method * @ejb:create-method * @ejb:transaction
type="Required" */ public PropertyEJBPK ejbCreate(String propertyKey,String
propertyValue,Integer projectID,
BundleEJBLocal bundleLocal) throws CreateException { System.out.println("creating PropretyEJB"+bundleLocal.getPrimaryKey()); setPropertyKeyName(propertyKey); setPropertyKeyValue(propertyValue); setProjectID(projectID); return null; } /** * Create method * * * * */ public void ejbPostCreate(String propertyKey,String propertyValue,Integer
projectID, BundleEJBLocal bundleLocal) throws CreateException { System.out.println("PropertyEJB-postcreate bundleID="); setBundle(bundleLocal); } **************************ejb-jar**************************************** <!--
Relationships --> <relationships > <ejb-relation
> <ejb-relation-name>bundle-properties</ejb-relation-name> <ejb-relationship-role >
<ejb-relationship-role-name>properties-belongto-bundle</ejb-relationship-role-name> <multiplicity>Many</multiplicity> <relationship-role-source > <ejb-name>PropertyEJB</ejb-name>
</relationship-role-source> <cmr-field
> <cmr-field-name>bundle</cmr-field-name> </cmr-field> </ejb-relationship-role> <ejb-relationship-role
>
<ejb-relationship-role-name>bundle-has-properties</ejb-relationship-role-name> <multiplicity>One</multiplicity> <relationship-role-source > <ejb-name>BundleEJB</ejb-name>
</relationship-role-source> <cmr-field
> <cmr-field-name>propertiesInBundle</cmr-field-name> <cmr-field-type>java.util.Collection</cmr-field-type> </cmr-field> </ejb-relationship-role> </ejb-relation> </relationships> ********************************jbosscmp-jdbc**************************** <relationships> <ejb-relation> <ejb-relation-name>bundle-properties</ejb-relation-name>
<foreign-key-mapping/> <ejb-relationship-role> <ejb-relationship-role-name>properties-belongto-bundle</ejb-relationship-role-name> <fk-constraint>true</fk-constraint> <key-fields/> </ejb-relationship-role> <ejb-relationship-role>
<ejb-relationship-role-name>bundle-has-properties</ejb-relationship-role-name> <key-fields> <key-field>
<field-name>entityID</field-name>
<column-name>bundle_id_fk</column-name> </key-field>
</key-fields> </ejb-relationship-role> </ejb-relation>
</relationships> |
- Re: ejbPostCreate Avi Kivity
- ejbPostCreate Dave Ford
- Re: ejbPostCreate Gene Chuang
- Re: ejbPostCreate Nicholas Whitehead
- Manish Shah
