public class PersistentDescriptor extends Object implements ClassDescriptor
| Modifier and Type | Field and Description |
|---|---|
protected Collection<ObjAttribute> |
allDiscriminatorColumns |
protected Map<String,Property> |
declaredProperties |
protected ObjEntity |
entity |
protected EntityInheritanceTree |
entityInheritanceTree |
protected Expression |
entityQualifier |
protected Collection<AttributeProperty> |
idProperties |
protected Collection<ArcProperty> |
mapArcProperties |
protected Class<?> |
objectClass |
protected Accessor |
persistenceStateAccessor |
protected Map<String,Property> |
properties |
protected Collection<DbEntity> |
rootDbEntities |
protected Map<String,ClassDescriptor> |
subclassDescriptors |
protected ClassDescriptor |
superclassDescriptor |
| Constructor and Description |
|---|
PersistentDescriptor()
Creates a PersistentDescriptor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDeclaredProperty(Property property)
Registers a property.
|
void |
addRootDbEntity(DbEntity dbEntity)
Adds a root DbEntity to the list of roots, filtering duplicates.
|
void |
addSubclassDescriptor(String className,
ClassDescriptor subclassDescriptor)
Adds a subclass descriptor that maps to a given class name.
|
void |
addSuperProperty(Property property)
Registers a superclass property.
|
Object |
createObject()
Creates a new instance of a class described by this object.
|
Property |
getDeclaredProperty(String propertyName)
Returns a Java Bean property descriptor matching property name or null if no such
property is found.
|
Collection<ObjAttribute> |
getDiscriminatorColumns()
Returns a collection of ObjAttribute for the described class, its superclasses and
subclasses, that participate in inheritance qualifier.
|
ObjEntity |
getEntity()
Returns an ObjEntity associated with this descriptor.
|
EntityInheritanceTree |
getEntityInheritanceTree() |
Expression |
getEntityQualifier()
Returns entity qualifier as a Cayenne expression that includes qualifiers for this
entity and all subentities.
|
Collection<AttributeProperty> |
getIdProperties()
Returns a collection of the properties mapped to id columns.
|
Collection<ArcProperty> |
getMapArcProperties()
Returns a collection over the arc properties whose reverse arcs are to-many maps.
|
Class<?> |
getObjectClass()
Returns a class mapped by this descriptor.
|
Property |
getProperty(String propertyName)
Recursively looks up property descriptor in this class descriptor and all
superclass descriptors.
|
Collection<DbEntity> |
getRootDbEntities()
Returns a collection of DbEntities that are the root tables for this descriptor's
ObjEntity.
|
ClassDescriptor |
getSubclassDescriptor(Class<?> objectClass)
Returns the most "specialized" descriptor for a given class.
|
ClassDescriptor |
getSuperclassDescriptor()
Returns a descriptor of the mapped superclass or null if the descriptor's entity
sits at the top of inheritance hierarchy.
|
boolean |
hasSubclasses()
Returns whether this class has persistent subclasses.
|
void |
injectValueHolders(Object object)
Invokes 'prepareForAccess' of a super descriptor and then invokes
'prepareForAccess' of each declared property.
|
boolean |
isFault(Object object)
Returns true if an object is not fully resolved.
|
void |
removeDeclaredProperty(String propertyName)
Removes declared property.
|
void |
setDiscriminatorColumns(Collection<ObjAttribute> columns) |
void |
setEntity(ObjEntity entity) |
void |
setEntityInheritanceTree(EntityInheritanceTree entityInheritanceTree) |
void |
setEntityQualifier(Expression entityQualifier) |
void |
setPersistenceStateAccessor(Accessor persistenceStateAccessor) |
void |
setSuperclassDescriptor(ClassDescriptor superclassDescriptor) |
void |
shallowMerge(Object from,
Object to)
Copies object properties from one object to another.
|
boolean |
visitAllProperties(PropertyVisitor visitor)
Passes the visitor to the properties "visit" method for a combination of all
properties, including properties declared in this descriptor, its super
descriptors, and all subdescriptors.
|
boolean |
visitDeclaredProperties(PropertyVisitor visitor)
Passes the visitor to the properties "visit" method for all properties declared in
this descriptor.
|
boolean |
visitProperties(PropertyVisitor visitor)
Passes the visitor to the properties "visit" method for all properties declared in
this descriptor and all its super-decsriptors.
|
protected ClassDescriptor superclassDescriptor
protected Class<?> objectClass
protected Map<String,ClassDescriptor> subclassDescriptors
protected Accessor persistenceStateAccessor
protected ObjEntity entity
protected Collection<DbEntity> rootDbEntities
protected EntityInheritanceTree entityInheritanceTree
protected Collection<AttributeProperty> idProperties
protected Collection<ArcProperty> mapArcProperties
protected Collection<ObjAttribute> allDiscriminatorColumns
protected Expression entityQualifier
public PersistentDescriptor()
public void setDiscriminatorColumns(Collection<ObjAttribute> columns)
public void addSuperProperty(Property property)
public void addDeclaredProperty(Property property)
public void addRootDbEntity(DbEntity dbEntity)
public void removeDeclaredProperty(String propertyName)
public void addSubclassDescriptor(String className, ClassDescriptor subclassDescriptor)
public ObjEntity getEntity()
ClassDescriptorgetEntity in interface ClassDescriptorpublic Collection<DbEntity> getRootDbEntities()
ClassDescriptorgetRootDbEntities in interface ClassDescriptorpublic boolean isFault(Object object)
ClassDescriptorisFault in interface ClassDescriptorpublic Class<?> getObjectClass()
ClassDescriptorgetObjectClass in interface ClassDescriptorpublic ClassDescriptor getSubclassDescriptor(Class<?> objectClass)
ClassDescriptorthis.getObjectClass().isAssignableFrom(objectClass)
getSubclassDescriptor in interface ClassDescriptorpublic Collection<ObjAttribute> getDiscriminatorColumns()
ClassDescriptorgetDiscriminatorColumns in interface ClassDescriptorpublic Collection<AttributeProperty> getIdProperties()
ClassDescriptorgetIdProperties in interface ClassDescriptorpublic Collection<ArcProperty> getMapArcProperties()
ClassDescriptorarc.getComplimentaryReverseArc() instanceof ToManyMapProperty
getMapArcProperties in interface ClassDescriptorpublic Property getProperty(String propertyName)
getProperty in interface ClassDescriptorpublic Property getDeclaredProperty(String propertyName)
ClassDescriptorAttributeProperty,
ToManyProperty, ToOneProperty.getDeclaredProperty in interface ClassDescriptorpublic ClassDescriptor getSuperclassDescriptor()
getSuperclassDescriptor in interface ClassDescriptorpublic Object createObject()
createObject in interface ClassDescriptorpublic void injectValueHolders(Object object) throws PropertyException
injectValueHolders in interface ClassDescriptorPropertyExceptionpublic void shallowMerge(Object from, Object to) throws PropertyException
shallowMerge in interface ClassDescriptorPropertyExceptionpublic boolean visitDeclaredProperties(PropertyVisitor visitor)
ClassDescriptorvisitDeclaredProperties in interface ClassDescriptorpublic boolean visitAllProperties(PropertyVisitor visitor)
ClassDescriptorvisitAllProperties in interface ClassDescriptorpublic boolean visitProperties(PropertyVisitor visitor)
ClassDescriptorvisitProperties in interface ClassDescriptorpublic void setPersistenceStateAccessor(Accessor persistenceStateAccessor)
public void setEntity(ObjEntity entity)
public void setSuperclassDescriptor(ClassDescriptor superclassDescriptor)
public Expression getEntityQualifier()
ClassDescriptorgetEntityQualifier in interface ClassDescriptorpublic void setEntityQualifier(Expression entityQualifier)
public EntityInheritanceTree getEntityInheritanceTree()
getEntityInheritanceTree in interface ClassDescriptorpublic void setEntityInheritanceTree(EntityInheritanceTree entityInheritanceTree)
public boolean hasSubclasses()
ClassDescriptorhasSubclasses in interface ClassDescriptorCopyright © 2001–2018 Apache Cayenne. All rights reserved.