Hi Hibernate-friends,
I´ve a little problem and hope to find a solution here.
I´ve 2 tables, table BOOKDATA for book-data (e.g author, ISBN,...) and table BOOKLANGUAGE for language information (e.g title in english,german,spanish; price in GB, Germany, Spain;...)
Code:
table BOOK:
BookID Author ISBN
1 Smith 1111111111
2 Jones 2222222222
table BOOKLANGUAGE
LangID RefBookId Language title
1 1 english car
2 1 german Auto
3 1 spanish coche
"BookId" and "LangId" are primary keys. One-To-Many reltationship exists between "BookID" and "RefBookID".
In my application I´m using JSF with primefaces. Therefore I need 1 Pojo (BookId,author,ISBN,langugae,title) to visualize these data in one table. These data must be at on hierarchical level. In one-to-many relation there 2 hierarchical levels.
My question is: How can I combine "BOOK" and "BOOKLANGUAGE" in 1 pojo on hierarchical level in a good (performant) way and use the advantage of one-to-many relation? Is there a best practice for it? I haven´t found an answer.
I hope you can help me.
Thanks.