• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inverse & cascade attribute - Help !!!

 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaikiran, the link provided by you is really a nice one. but sill i have few doubts :

In case of Item -> Bid Bidirectional Association

Item.hbm.xml


Item.java


Can you please justify the output in the following cases :
Case 1:
inverse="true"
bid.setItem(this);
RESULT : No Error. No INERST statement

Case 2:
inverse="false"
bid.setItem(this);
RESULT : No Error. No INERST statement

Case 3:
inverse="true"
this.bids.add(bid);
RESULT : Exception in thread "main" org.hibernate.PropertyValueException: not-null property references a null or transient value: Bid.item

Case 4:

inverse="false"
this.bids.add(bid);
RESULT : Exception in thread "main" org.hibernate.PropertyValueException: not-null property references a null or transient value: Bid.item
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sandeep,

Sorry i did not notice your post in your original thread here. Let's continue the discussion in that thread.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic