• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate reverse engineering on a denormalized database

 
harsha edupuganti
Greenhorn
Posts: 4
IBM DB2 Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am working on a database which is not normalized.
i tried to implement hibernate reverse engineering to generate the Pojo classes for all the tables in the database but i couldnt do it because none of the tables have any primary keys or foreign keys in them.
can i use reverse engineering on a denormalized database?
if not, what are the other options? JDBC?
 
Rajit vreddi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is possible You can still generate pojos on denormalized database.if you don't have PK in your table the composite keys will be generated using columns of table.
 
harsha edupuganti
Greenhorn
Posts: 4
IBM DB2 Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the error i get. please take a look.
how do i reverse engineer a database with tables that have no primary keys?
netbeans error.jpg
[Thumbnail for netbeans error.jpg]
 
surendra babu k
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

use <id> with in <class> in hbm.xml and in that you need to specify which property need to be as a primary key
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic