When implementing a "bag" relationship with a collection, is there a difference between the following two models? And would the second snippet possibly cause problems when closing a transaction? Thanks!
Code:
/**
* @hibernate.bag
* table="ITEMS"
* cascade="all"
* @hibernate.collection-key
* column="CHANNEL_ID"
* @hibernate.collection-one-to-many
* class="de.nava.informa.impl.hibernate.Item"
*/
public Collection getItems() {
return items;
}
public void setItems(Collection items) {
this.items = items;
}
versus:
Code:
/**
...
...
public void setItems(Collection items) {
this.items = new ArrayList(items);
}