HHH-5709: New property added to PersistentClass to hold the name of the entity compliant with JSR-317 spec. Used by JPA2 metamodel.

This commit is contained in:
Tomasz Blachowicz 2010-11-03 14:10:58 +00:00
parent b48c5b601c
commit f29fab99a6
3 changed files with 11 additions and 1 deletions

View File

@ -195,6 +195,7 @@ public class EntityBinder {
persistentClass.setAbstract( annotatedClass.isAbstract() );
persistentClass.setClassName( annotatedClass.getName() );
persistentClass.setNodeName( name );
persistentClass.setAnnotatedEntityName(name);
//persistentClass.setDynamic(false); //no longer needed with the Entity name refactoring?
persistentClass.setEntityName( annotatedClass.getName() );
bindDiscriminatorValue();

View File

@ -57,6 +57,7 @@ public abstract class PersistentClass implements Serializable, Filterable, MetaA
private String proxyInterfaceName;
private String nodeName;
private String annotatedEntityName;
private String discriminatorValue;
private boolean lazy;
@ -735,6 +736,14 @@ public abstract class PersistentClass implements Serializable, Filterable, MetaA
public void setNodeName(String nodeName) {
this.nodeName = nodeName;
}
public String getAnnotatedEntityName() {
return annotatedEntityName;
}
public void setAnnotatedEntityName(String annotatedEntityName) {
this.annotatedEntityName = annotatedEntityName;
}
public boolean hasPojoRepresentation() {
return getClassName()!=null;

View File

@ -94,7 +94,7 @@ public class MetamodelImpl implements Metamodel, Serializable {
EntityTypeImpl entityType = new EntityTypeImpl(
javaType,
superType,
persistentClass.getNodeName(),
persistentClass.getAnnotatedEntityName(),
persistentClass.hasIdentifierProperty(),
persistentClass.isVersioned()
);