rdleeper wrote:
I forgot to mention that I already have a complete POJO domain model. The CMP Entity Beans were only for persistence to/from DB. Access to these EJB were accessed only via Session beans.
You are in exactly the same situation our project was in when we started. We had an OK domain model, and an OK database, not ideal, with some "strange" bits of design in parts, but essentially what we did was:
Use middlegen to create all the mapping files from the domain model. This will give you in reality a set up stub files that you will have to edit as follows:
put in the db field that maps to the equivalent field name in the class
put in the table name that maps to the class
tell it what the identity column is
Followed by a large amoutn of hand tweaking to get the associations right.
One of the biggest issues we had was all the collections in our domain model were lists not sets. We had to change all these as lists allow duplicates in which obviously is impossible to persist (unless you have an index column for each row in the list, which you are unlikely to have as its not very OO or obvious to put in when you aren't thinking of Hibernate when designing your domain model).
On a final note I can't recommend enough that you should buy "Hibernate in action", it really is worth every penny.