views:

353

answers:

1

I am working in a new part of an existing system. What are the disadvantages of auto-generating the classes for Hibernate for an existing database?

I just think that whatever design failures we have at the moment (and there are plenty) we will port to this new part of the system.

+1  A: 

Hibernate generation/reverse engineering is a good starting point in case the existing database's schemas are properly designed. Hibernate isn't able to guess dependencies without correct use of foreign keys and constraints. In any case it is likely that you will end up writing at least couple reveng rules for Hibernate to handle database specific cases like sequences.

In case your DB design is seriously messed up but you want to use something else than hand written statements look at iBatis instead of Hibernate.

Petteri Hietavirta