Anyone got xdoclet working with OC4J with a bidirectional 1:m mapping?
My tables don't confirm to the standard which would allow me to leave out the orion-ejb-jar.xml file. The example works fine in WebLogic 6.1 and 7 without any troubles and it works with OC4J if I manually create the orion-ejb-jar.xml file but I can't get xdoclet to give me what I want.


In the example a volume can be involved with many rentals, i.e. 1:M between VolumeInfo and RentalInfo (bidirectional though not strictly needed)

Here is what I need generated:

<cmp-field-mapping name="rentals">
<collection-mapping table="RENTALINFO">
<primkey-mapping>
<cmp-field-mapping persistence-name="VOLUME_ID" />
</primkey-mapping>
<value-mapping type="vs.entities.RentalInfo">
<cmp-field-mapping>
<entity-ref home="ejb/vs-entities-RentalInfoLocal">
<cmp-field-mapping name="volume" persistence-name="ID" />
</entity-ref>
</cmp-field-mapping>
</value-mapping>
</collection-mapping>
</cmp-field-mapping>

Here is what I am giving ejbdoclet:

In VolumeInfoBean:

* @ejb.relation
* name="rentalinfo-volumeinfo"
* role-name="volume-has-rentals"
* @ejb.persistence
* @orion.persistence
* table-name="RENTALINFO"
* column-name="VOLUME_ID"
* type="vs.entities.RentalInfo"
*/
public abstract java.util.Collection getRentals();

In RentalInfoBean:

* @ejb.interface-method view-type="local"
* @ejb.relation
* name="rentalinfo-volumeinfo"
* role-name="rental-has-volume"
* cascade-delete="yes"
* @weblogic.column-map
* key-column="ID"
* foreign-key-column="VOLUME_ID"
* @jboss.relation
* related-pk-field="ID"
* fk-column="VOLUME_ID"
*/
public abstract vs.entities.VolumeInfoLocal getVolume();

Here is what is being generated:

<cmp-field-mapping name="rentals">
<collection-mapping table="RENTALINFO" >
<primkey-mapping>
<fields>
<cmp-field-mapping name="volume" persistence-name="ID" />
</fields>
</primkey-mapping>
<value-mapping type="vs.entities.RentalInfo">
</value-mapping>
</collection-mapping>
</cmp-field-mapping>

I can add an ejb-class-name param to get the entity-ref field but then I also get an extraneous field on the outer cmp-field-mapping element.

I would normally think I should be able to leave out the @ejb.persistence field but without it nothing was generated. From examining the xdt files in the xdoclet source it appears that it just isn't finished. Can anyone confirm or is it just me not getting how to use this correctly?

Thanks, Paul.




------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to