• 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:

duplicate generated as a result of foreign keys

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using the middlegen-hibernate plugin.(Middlegen-Hibernate-r4)

Here is a summary of the issue that I am facing.I am trying to use middlegen to read the database schema to autogenerate the hibernate mapping files for me. I am then using hbm2java to convert the mapping files into POJOs.

The schema that I am reading has many tables in it and I have specified the specific tables that I am interested in by using the <table> element tag in the ant specific build.xml file. The appropriate hbm.xml files are generated,however there is an issue with them.

Some of the columns in the tables that I have specified in the xml file are foreign keys in other tables.Middlegen seems to be generating a seperate <meta / property > tag for each of the tables that it references. So if column X in table A is a foreign key in 3 tables. I have the property for column x thrice in my A.hbm.xml file in class A and hence also correspondingly in my POJO I have the attribute declared thrice.

Is there a setting in the middlegen task that I need to turn on. I tried swithching the genIntegratedComposite key in the hibernate task either ways but that doesnt seem to help.

Please advise /provide solution for the same.
 
Note to self: don't get into a fist fight with a cactus. Command this tiny ad to do it:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic