>>Note that it would be fairly easy to logically group the elements by >>categories such as demographics, past employment, education, etc.
I would suggest to wrap all attribute in appropriate classes and combine them into one main class (or operate with them from one class) which has with related classes LAZY fetch strategy
This problem is not jpa specific. What database schema works best is at least depending on
a.) the relationship of the attributes,
b.) how many of those attributes are actually needed during procesing,
c.) the expected amount of data.
So I would suggest you create an entity relationship model first.
Thanks for your reply. I am all new to this thing so excuse my "newbieness". Ok, so what if I have a table named participants and each row represent 1 participant with the 400 or so data elements collected for that participant. What would be the best way to handle that with EJB3? Most of the attributes are small, ie: gender, are you employed?, etc.
This is not so much an EJB question but a question of database design.
There is no such thing as "the right way" to it. It all depends on the data and what you want to do with it. One of the key question is: Should you normalize the data?
This depends on what you want to do with that data. For example if you only want to dump records as fast as possible into the database I would use the fully denormalized form you suggested. However, this scenario is very unlikely.
So usually you will want to have some denomalization. How much depends again what you want to do. If you will want to filter your partictpants according to different criteria you might consider a star schema. For maximum transaction speed you would prefer to normalize the data further.
Normalization makes especially sense if you want to enforce data consistency. In your example you could move the former employers to a table of their own to make sure that there are no different spelling of the company's name.
So I cannot really help you. You know best what you want to do with the data in your application.