This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!