Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Would like advise mapping Hibernate objects

 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Would like guidance mapping objects in Hibernate
I keep getting Error :
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

I have Table "persons" Person is related to other persons through relation table (relations)
PersonHib - holds 2 collection of "relation" objects - children, parents (need this connection in order for the relation record to hold relation data)
RelationHib - hold 2 references Parent, and Child (both PersonHib)
I Would like to be able to persist the parents through RelationHib

What is the right way of mapping this situation?

For example:




My current mapping :
PersonHib:

RelationHib:
 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I use Annotations, so I won't be much help with the xml.

But where is the <id> for the person mapping?

Mark
 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark Spritzler wrote:Sorry, I use Annotations, so I won't be much help with the xml.
But where is the <id> for the person mapping?
Mark


I omitted irrelevant fields for the example,
Anyway Person have ID mapping.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic