Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Xdoclet CMP EJB Weblogic

 
Sandeep Awasthi
Ranch Hand
Posts: 597
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am new to both xdoclet and weblogic.

I have confusion about foriegn-key-column and key-column in @weblogic.column-map tag for many to many relationship



I have many to many relationship between Order EJB and Item EJB. join table name is OrderLine.


In Order EJB I have cmr method
public abstract java.util.Collection getItems();

which one @weblogic.column-map tag is correct? is foriegn-key reference from Order table to OrderLine table or OrderLine table to Order table. My impression is it is from OrderLine table to Order table. Just want to confirm it.



1)

public abstract class OrderEJB implements EntityBean {

....
....
/**
* @ejb.interface-method
* view-type="local"
*
* @ejb.relation
* name="OrdersItems"
* role-name="Order"
*
* @weblogic.relation
* join-table-name="OrderLine"
* generate="false"
*
* @weblogic.column-map
* foriegn-key-column="order_itemId"
* key-column="orderline_item_id"
*

*/
public abstract Collection getItems();

Or

2)

public abstract class OrderEJB implements EntityBean {

....
....
/**
* @ejb.interface-method
* view-type="local"
*
* @ejb.relation
* name="OrdersItems"
* role-name="Order"
*
* @weblogic.relation
* join-table-name="OrderLine"
* generate="false"
*
* @weblogic.column-map
* foriegn-key-column="orderline_itemId"
* key-column="order_item_id"
*

*/
public abstract Collection getItems();




My second question is suppose I have composite foriegn-key, in that case how will I define @weblogic.column-map tags,


will it be something like this?

public abstract class OrderEJB implements EntityBean {

....
....
/**
* @ejb.interface-method
* view-type="local"
*
* @ejb.relation
* name="OrdersItems"
* role-name="Order"
*
* @weblogic.relation
* join-table-name="OrderLine"
* generate="false"
*
* @weblogic.column-map
* foriegn-key-column="fk_col1"
* key-column="pk_col1"
*
* @weblogic.column-map
* foriegn-key-column="fk_col2"
* key-column="pk_col2"

*/
public abstract Collection getItems();

[ November 28, 2005: Message edited by: Rajesh Thankare ]

[ November 28, 2005: Message edited by: Rajesh Thankare ]
[ November 28, 2005: Message edited by: Rajesh Thankare ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!