3

I am using Hibernate 3.5, when I do the reverse engineering with SQL 2012 and Hibernate I am getting following error

org.hibernate.cfg.JDBCBinderException: Duplicate class name com.pepspb.entity.CheckConstraints generated for org.hibernate.mapping.Table(pepspb.sys.check_constraints). Same name where generated for org.hibernate.mapping.Table(pepspb.sys.check_constraints)
Duplicate class name 'com.pepspb.entity.CheckConstraints generated for org.hibernate.mapping.Table(pepspb.sys.check_constraints). Same name where generated for org.hibernate.mapping.Table(pepspb.sys.check_constraints)
<No message>

Can any one please tell me what is the reason?

2 Answers 2

2

This sometimes happens when you mix the original sources with the generated ones. To resolve the issue you should separate src and gensrc at the module. And don't use gensrc where you have generated classes via reverse engineering as the source folder. Just compare or even better diff them and merge avoiding duplicate classes.

Sign up to request clarification or add additional context in comments.

3 Comments

What if I got something of this sort: "org.hibernate.cfg.JDBCBinderException: Duplicate class name 'CheckConstraints' generated for 'org.hibernate.mapping.Table(e2rm_maintenance_development2.sys.check_constraints)'. Same name where generated for 'org.hibernate.mapping.Table(e2rm_maintenance_development2.sys.check_constraints)' Duplicate class name 'CheckConstraints' generated for 'org.hibernate.mapping.Table(e2rm_maintenance_development2.sys.check_constraints)'. Same name where generated for 'org.hibernate.mapping.Table(e2rm_maintenance_development2.sys.check_constraints)'"
I am using Hibernate Tools for Eclipse... But I am getting the above error which is really confusing because the "(e2rm_maintenance_development2.sys.check_constraints‌" is mentioned as the duplicate of itself.
You should upgrade to the latest version, and follow this answer after upgrade.
0

In my case, for mysql there is a sakila default database, its table name duplicate of other database, filter match-catalog at reveng.xml works:

<table-filter match-catalog="nameofdb" match-name=".*" />

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.