• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Need help with Reverse Engineering to create JAVA objects

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

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.

customer

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)

stable

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
 
I AM MIGHTY! Especially when I hold this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic