I know it is little strange, but :
We have two classes:
Hibernate version: 3.1.2 , Annotation 3.1beta9
Code:
package com.icw.phr.record.domain;
@javax.persistence.Entity
@javax.persistence.Table(schema = "Record", name = DocumentReference")
public class DocumentReference extends AbstractDomainObject{...}
package com.icw.phr.workplace.domain;
@javax.persistence.Entity
@javax.persistence.Table(schema = "Workplace", name = DocumentReference")
public class DocumentReference extends AbstractDomainObject{...}
We put them in one Configuration, and when we try to build SessionFactory, we get this exception :
org.hibernate.AnnotationException: Use of the same entity name twice: DocumentReference
at org.hibernate.cfg.annotations.EntityBinder.bindEntity(EntityBinder.java:204)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:474)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:295)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:216)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1168)