Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate annotation - problem with one to many relationship

 
Paolo Tini Brunozzi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello World,
I'm studying hibernate and hibernate annotations, making a web application to catalog my books.
So, should I put the publisher in a table (Publisher Name and Id) and, in another table (publisher Id and isbn prefix), the list of isbn codes prefix
I have a problem with one to many relationship.

Can anyone help me ? Thank you











When I invoke the method inserisciCasaEditrice, the following output is returned by Hibernate:



I think Hibernate, in the select statement, exchanges the table ISBNCE with his java class representation PrefixISBN but do not know how to correct it
Thank for help and sorry for my very little english
 
Paolo Tini Brunozzi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I have found a solution.
Now, the method inserisciCasaEditrice works.
In the following, the correct code





casaEditrice of PrefixISBN class must refer to the parent object CasaEditrice

The rest is the same
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic