Register / Login
Win a copy of
The Little Book of Impediments (e-book only)
this week in the
Agile and Other Processes
Object Relational Mapping
Unidirectional Associations - Parent/Child Not Possible ?
posted 9 years ago
Suppose Item - Bid as unidirectional association from Item to Bid as One-to-many. Also bid can't exists independently i.e. is must be associated with an item.
// Item - Bid Association (one-to-many)
Set bids = new
Bid(Long bidId, double amount)
As Item-Bid is unidirectional, Bid class doesn't have an Item as property.
Hence we can create Bid independent of Item (using Bid(bidId,amount))...
This is incorrect scenario ....
@OneToMany - Is thi bidirectional always?
Item - Bid Unidirectional PROBLEM !!!
Relationship between Bid and User
what us mean mappedBy="item" ?
what is mean mappedBy