Package org.hibernate.mapping
Class MappedSuperclass
- java.lang.Object
-
- org.hibernate.mapping.MappedSuperclass
-
public class MappedSuperclass extends java.lang.ObjectRepresents a @MappedSuperclass. A @MappedSuperclass can be a superclass of an @Entity (root or not) This class primary goal is to give a representation to @MappedSuperclass in the metamodel in order to reflect them in the JPA 2 metamodel. Do not use outside this use case. A proper redesign will be evaluated in Hibernate 4 Implementation details: properties are copies of their closest sub-persistentClass versions
-
-
Constructor Summary
Constructors Constructor Description MappedSuperclass(MappedSuperclass superMappedSuperclass, PersistentClass superPersistentClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDeclaredProperty(Property p)ComponentgetDeclaredIdentifierMapper()PropertygetDeclaredIdentifierProperty()java.util.IteratorgetDeclaredPropertyIterator()PropertygetDeclaredVersion()ComponentgetIdentifierMapper()PropertygetIdentifierProperty()java.lang.ClassgetMappedClass()MappedSuperclassgetSuperMappedSuperclass()Returns the first superclass marked as @MappedSuperclass or null if: - none exists - or the first persistent superclass found is an @EntityPersistentClassgetSuperPersistentClass()Returns the PersistentClass of the first superclass marked as @Entity or null if none existsPropertygetVersion()booleanhasIdentifierProperty()booleanhasProperty(java.lang.String name)Check to see if this MappedSuperclass defines a property with the given name.booleanisPropertyDefinedInHierarchy(java.lang.String name)Check to see if a property with the given name exists in this MappedSuperclass or in any of its super hierarchy.booleanisVersioned()voidsetDeclaredIdentifierMapper(Component identifierMapper)voidsetDeclaredIdentifierProperty(Property prop)voidsetDeclaredVersion(Property prop)voidsetMappedClass(java.lang.Class mappedClass)
-
-
-
Constructor Detail
-
MappedSuperclass
public MappedSuperclass(MappedSuperclass superMappedSuperclass, PersistentClass superPersistentClass)
-
-
Method Detail
-
getSuperMappedSuperclass
public MappedSuperclass getSuperMappedSuperclass()
Returns the first superclass marked as @MappedSuperclass or null if: - none exists - or the first persistent superclass found is an @Entity- Returns:
- the super MappedSuperclass
-
hasIdentifierProperty
public boolean hasIdentifierProperty()
-
isVersioned
public boolean isVersioned()
-
getSuperPersistentClass
public PersistentClass getSuperPersistentClass()
Returns the PersistentClass of the first superclass marked as @Entity or null if none exists- Returns:
- the PersistentClass of the superclass
-
getDeclaredPropertyIterator
public java.util.Iterator getDeclaredPropertyIterator()
-
addDeclaredProperty
public void addDeclaredProperty(Property p)
-
getMappedClass
public java.lang.Class getMappedClass()
-
setMappedClass
public void setMappedClass(java.lang.Class mappedClass)
-
getIdentifierProperty
public Property getIdentifierProperty()
-
getDeclaredIdentifierProperty
public Property getDeclaredIdentifierProperty()
-
setDeclaredIdentifierProperty
public void setDeclaredIdentifierProperty(Property prop)
-
getVersion
public Property getVersion()
-
getDeclaredVersion
public Property getDeclaredVersion()
-
setDeclaredVersion
public void setDeclaredVersion(Property prop)
-
getIdentifierMapper
public Component getIdentifierMapper()
-
getDeclaredIdentifierMapper
public Component getDeclaredIdentifierMapper()
-
setDeclaredIdentifierMapper
public void setDeclaredIdentifierMapper(Component identifierMapper)
-
hasProperty
public boolean hasProperty(java.lang.String name)
Check to see if this MappedSuperclass defines a property with the given name.- Parameters:
name- The property name to check- Returns:
trueif a property with that name exists;falseif not
-
isPropertyDefinedInHierarchy
public boolean isPropertyDefinedInHierarchy(java.lang.String name)
Check to see if a property with the given name exists in this MappedSuperclass or in any of its super hierarchy.- Parameters:
name- The property name to check- Returns:
trueif a property with that name exists;falseif not
-
-