|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.reflect.PersistentDescriptor
public class PersistentDescriptor
A default ClassDescriptor implementation for persistent objects.
Field Summary | |
---|---|
protected java.util.Collection<ObjAttribute> |
allDiscriminatorColumns
|
protected java.util.Map<java.lang.String,Property> |
declaredProperties
|
protected ObjEntity |
entity
|
protected EntityInheritanceTree |
entityInheritanceTree
|
protected Expression |
entityQualifier
|
protected java.util.Collection<AttributeProperty> |
idProperties
|
protected java.util.Collection<ArcProperty> |
mapArcProperties
|
protected java.lang.Class<?> |
objectClass
|
protected Accessor |
persistenceStateAccessor
|
protected java.util.Collection<DbEntity> |
rootDbEntities
|
protected java.util.Map<java.lang.String,ClassDescriptor> |
subclassDescriptors
|
protected ClassDescriptor |
superclassDescriptor
|
protected java.util.Map<java.lang.String,Property> |
superProperties
|
Constructor Summary | |
---|---|
PersistentDescriptor()
Creates a PersistentDescriptor. |
Method Summary | |
---|---|
void |
addDeclaredProperty(Property property)
Registers a property. |
void |
addRootDbEntity(DbEntity dbEntity)
Adds a root DbEntity to the list of roots, filtering duplicates. |
void |
addSubclassDescriptor(java.lang.String className,
ClassDescriptor subclassDescriptor)
Adds a subclass descriptor that maps to a given class name. |
void |
addSuperProperty(Property property)
Registers a superclass property. |
java.lang.Object |
createObject()
Creates a new instance of a class described by this object. |
Property |
getDeclaredProperty(java.lang.String propertyName)
Returns a Java Bean property descriptor matching property name or null if no such property is found. |
java.util.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. |
java.util.Collection<AttributeProperty> |
getIdProperties()
Returns a collection of the properties mapped to id columns. |
java.util.Collection<ArcProperty> |
getMapArcProperties()
Returns a collection over the arc properties whose reverse arcs are to-many maps. |
java.lang.Class<?> |
getObjectClass()
Returns a class mapped by this descriptor. |
Property |
getProperty(java.lang.String propertyName)
Recursively looks up property descriptor in this class descriptor and all superclass descriptors. |
java.util.Collection<DbEntity> |
getRootDbEntities()
Returns a collection of DbEntities that are the root tables for this descriptor's ObjEntity. |
ClassDescriptor |
getSubclassDescriptor(java.lang.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(java.lang.Object object)
Invokes 'prepareForAccess' of a super descriptor and then invokes 'prepareForAccess' of each declared property. |
boolean |
isFault(java.lang.Object object)
Returns true if an object is not fully resolved. |
void |
removeDeclaredProperty(java.lang.String propertyName)
Removes declared property. |
void |
setDiscriminatorColumns(java.util.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(java.lang.Object from,
java.lang.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ClassDescriptor superclassDescriptor
protected java.lang.Class<?> objectClass
protected java.util.Map<java.lang.String,Property> declaredProperties
protected java.util.Map<java.lang.String,Property> superProperties
protected java.util.Map<java.lang.String,ClassDescriptor> subclassDescriptors
protected Accessor persistenceStateAccessor
protected ObjEntity entity
protected java.util.Collection<DbEntity> rootDbEntities
protected EntityInheritanceTree entityInheritanceTree
protected java.util.Collection<AttributeProperty> idProperties
protected java.util.Collection<ArcProperty> mapArcProperties
protected java.util.Collection<ObjAttribute> allDiscriminatorColumns
protected Expression entityQualifier
Constructor Detail |
---|
public PersistentDescriptor()
Method Detail |
---|
public void setDiscriminatorColumns(java.util.Collection<ObjAttribute> columns)
public void addSuperProperty(Property property)
public void addDeclaredProperty(Property property)
public void addRootDbEntity(DbEntity dbEntity)
public void removeDeclaredProperty(java.lang.String propertyName)
public void addSubclassDescriptor(java.lang.String className, ClassDescriptor subclassDescriptor)
public ObjEntity getEntity()
ClassDescriptor
getEntity
in interface ClassDescriptor
public java.util.Collection<DbEntity> getRootDbEntities()
ClassDescriptor
getRootDbEntities
in interface ClassDescriptor
public boolean isFault(java.lang.Object object)
ClassDescriptor
isFault
in interface ClassDescriptor
public java.lang.Class<?> getObjectClass()
ClassDescriptor
getObjectClass
in interface ClassDescriptor
public ClassDescriptor getSubclassDescriptor(java.lang.Class<?> objectClass)
ClassDescriptor
this.getObjectClass().isAssignableFrom(objectClass)
getSubclassDescriptor
in interface ClassDescriptor
public java.util.Collection<ObjAttribute> getDiscriminatorColumns()
ClassDescriptor
getDiscriminatorColumns
in interface ClassDescriptor
public java.util.Collection<AttributeProperty> getIdProperties()
ClassDescriptor
getIdProperties
in interface ClassDescriptor
public java.util.Collection<ArcProperty> getMapArcProperties()
ClassDescriptor
arc.getComplimentaryReverseArc() instanceof ToManyMapProperty
getMapArcProperties
in interface ClassDescriptor
public Property getProperty(java.lang.String propertyName)
getProperty
in interface ClassDescriptor
public Property getDeclaredProperty(java.lang.String propertyName)
ClassDescriptor
AttributeProperty
,
ToManyProperty
, ToOneProperty
.
getDeclaredProperty
in interface ClassDescriptor
public ClassDescriptor getSuperclassDescriptor()
getSuperclassDescriptor
in interface ClassDescriptor
public java.lang.Object createObject()
createObject
in interface ClassDescriptor
public void injectValueHolders(java.lang.Object object) throws PropertyException
injectValueHolders
in interface ClassDescriptor
PropertyException
public void shallowMerge(java.lang.Object from, java.lang.Object to) throws PropertyException
shallowMerge
in interface ClassDescriptor
PropertyException
public boolean visitDeclaredProperties(PropertyVisitor visitor)
ClassDescriptor
visitDeclaredProperties
in interface ClassDescriptor
public boolean visitAllProperties(PropertyVisitor visitor)
ClassDescriptor
visitAllProperties
in interface ClassDescriptor
public boolean visitProperties(PropertyVisitor visitor)
ClassDescriptor
visitProperties
in interface ClassDescriptor
public void setPersistenceStateAccessor(Accessor persistenceStateAccessor)
public void setEntity(ObjEntity entity)
public void setSuperclassDescriptor(ClassDescriptor superclassDescriptor)
public Expression getEntityQualifier()
ClassDescriptor
getEntityQualifier
in interface ClassDescriptor
public void setEntityQualifier(Expression entityQualifier)
public EntityInheritanceTree getEntityInheritanceTree()
getEntityInheritanceTree
in interface ClassDescriptor
public void setEntityInheritanceTree(EntityInheritanceTree entityInheritanceTree)
public boolean hasSubclasses()
ClassDescriptor
hasSubclasses
in interface ClassDescriptor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |