I am wondering why do we need to create databases with Oracle or MySQL while we can use ORMs such as Hibernate to easily generate them ?
Asked
Active
Viewed 171 times
2 Answers
3
Just taking an extract from the related post:
- It's always recommended to generate the schema manually, preferably by a tool supporting database schema revisions, such as the great Liquibase. Generating the schema from the entities is great in theory, but were fragile in practice and causes lots of problems in the long run(trust me on this).
- Same database may be used by different applications and not all of them would be using hibernate or even java. Database schema should not be dictated by ORM, it should be designed around the data and business requirements
- additional properties (generic term not java properties) on join tables work wonderfully in RDBMS but are somewhat complex and inefficient to use in an ORM. Doing such a mapping from ORM -> RDBMS might create tables that are not efficient. In theory, it is possible to build the exact same join table using hibernate generated code, but it would require some special care while writing the Entities

Community
- 1
- 1

Juned Ahsan
- 67,789
- 12
- 98
- 136
0
From my experience, I have much more control using the traditional RDBMS over ORMs. Testing is easier using a rdbms when designing/implementing your schema.

Sajal Dutta
- 18,272
- 11
- 52
- 74