-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: 2 table in 1 hierarchical pojo
PostPosted: Tue Sep 17, 2013 10:45 am 
Newbie

Joined: Mon Sep 02, 2013 12:11 pm
Posts: 10
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.