• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic