I wanted to create a Hibernate mapping file from my database for a few tables (not all). How can I achieve this?
When I am trying, it is considering my entire database and crashing without creating any mapping files. It gives me the following error:
org.hibernate.cfg.JDBCBinderException: Duplicate class name 'CheckConstraints' generated for 'org.hibernate.mapping.Table(AG_TXN.sys.check_constraints)'. Same name where generated for 'org.hibernate.mapping.Table(AG_TXN.sys.check_constraints)'
org.hibernate.cfg.JDBCBinderException: Duplicate class name 'CheckConstraints' generated for 'org.hibernate.mapping.Table(AG_TXN.sys.check_constraints)'. Same name where generated for 'org.hibernate.mapping.Table(AG_TXN.sys.check_constraints)'
You need to setup your reveng.xml to only look at specific tables. The tutorial you mentioned does not cover this. If you click Setup beside reveng.xml (seen in step 3 of that tutorial) you will be taken through a wizard to select what you want.
In the end you should expect to have an xml value like so that restricts to a table you want:
<schema-selection match-schema="COMMON_SCHEMA" match-table="CITY"/>
See the Red Hat site for the exact details on the Hibernate reveng.xml file.
I believe you are getting that exception because of two tables with the same name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With