HHH-4533 move metamodel storage to Hibernate Core

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@17873 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Emmanuel Bernard 2009-10-29 00:36:07 +00:00
parent f795bd31e4
commit 1352b5e25f
4 changed files with 20 additions and 12 deletions

View File

@ -986,6 +986,7 @@ public final class AnnotationBinder {
mappedSuperclass = mappings.getMappedSuperclass( type );
if (mappedSuperclass == null) {
mappedSuperclass = new org.hibernate.mapping.MappedSuperclass(parentSuperclass, superEntity );
mappedSuperclass.setMappedClass( type );
mappings.addMappedSuperclass( type, mappedSuperclass );
}
}

View File

@ -295,6 +295,16 @@ public class Configuration implements Serializable {
return tables.values().iterator();
}
/**
* Iterate the mapped superclasses mappings
* EXPERIMENTAL Consider this API as PRIVATE
*
* @return Iterator<MappedSuperclass> over the MappedSuperclass mapping currently contained in the configuration.
*/
public Iterator getMappedSuperclassMappings() {
return mappedSuperclasses.values().iterator();
}
/**
* Get the mapping for a particular entity
*
@ -2761,9 +2771,5 @@ public class Configuration implements Serializable {
public MappedSuperclass getMappedSuperclass(Class type) {
return (MappedSuperclass) mappedSuperclasses.get( type );
}
public Iterator iterateMappedSuperclasses() {
return mappedSuperclasses.values().iterator();
}
}
}

View File

@ -543,12 +543,4 @@ public interface Mappings {
* @return the MappedSuperclass
*/
org.hibernate.mapping.MappedSuperclass getMappedSuperclass(Class type);
/**
* Iterator over the MappedSuperclass mappings
* Use an iterator as a symetry to the other methods on Mappings
*
* @return mappedSuperclasses
*/
public Iterator iterateMappedSuperclasses();
}

View File

@ -20,6 +20,7 @@ public class MappedSuperclass {
private final MappedSuperclass superMappedSuperclass;
private final PersistentClass superPersistentClass;
private final List properties;
private Class mappedClass;
public MappedSuperclass(MappedSuperclass superMappedSuperclass, PersistentClass superPersistentClass) {
this.superMappedSuperclass = superMappedSuperclass;
@ -64,4 +65,12 @@ public class MappedSuperclass {
}
properties.add(p);
}
public Class getMappedClass() {
return mappedClass;
}
public void setMappedClass(Class mappedClass) {
this.mappedClass = mappedClass;
}
}