Just looking for some direction since I'm pretty new to JPA/Hibernate.
We have a pretty old db design that I have to work around. One table has over 150 columns (actually have a few tables like that!).
1) I am currently creating a new (large) web app with blazeds. I ran into design issue where different sections with different fields from the same table (large table). I could create an Entity with all fields and reuse it even though I will be using only about 25 fields all together. I could create an Entity that only contains the 25 fields and use it through out the app. I could also create a different Entity with only the fields being used for each different part of the large app (I have 3 areas that make a call for some of the fields of the large table).
I like the idea of one Entity that I could possibly reuse in different apps but this might cause a performance issue since I will be bring back so much data when I only need a few columns. If I create an Entity with only the fields needed, then I probably won't be able to reuse it in diff apps. Not sure about creating different Entity for each section (some overlap of fields, but mostly different in each case).
I think this will happen in lots of other cases. I know the db isn't the best of design due to the large number of columns, but it's what I have.
I would appreciate any other design tips that newbie's might need also or that other's have discovered when moving to JPA with a lagacy DB.
Thanks!
|