• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help with Reverse Engineering to create JAVA objects

Ish Fad
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am using MYSQL Database with Eclipse helios.
I am having problem adding object to POJO (Class created by Hibernate reverse engineering).
I have two tables customer and stitle. I have created One-to-Many relationship in MYSQL between this two tables.
titleId is foreign key in customer table. so one to many relation exist.


customerId as int(11) primary Key
titleId as Int(11) foreignKey FK_CTitleId (which is match to titleId in stitle table)
firstname as string(45)


titleId as int(11) primary Key
title as string(45)

When I run reverse engineering, I get two object STitle.java and Customer.java.
Also get two Customer.hbm.xml and Stitle.hbm.xml.
But I am getting titleId in Customer object as an Integer and not as STitle object.

Here is my hibernate-reverse-engineering file.

JAVA object it created

I don't understand why it is creating titleId as integer. It suppose to be object for table sTitle.

Please can someone help me.

Many thanks
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic