public class LazyClassDescriptorDecorator extends Object implements ClassDescriptor
Modifier and Type | Field and Description |
---|---|
protected ClassDescriptor |
descriptor |
protected ClassDescriptorMap |
descriptorMap |
protected String |
entityName |
Constructor and Description |
---|
LazyClassDescriptorDecorator(ClassDescriptorMap descriptorMap,
String entityName) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkDescriptorInitialized()
Checks whether decorated descriptor is initialized, and if not, creates it using
parent
ClassDescriptorMap . |
Object |
createObject()
Creates a new instance of a class described by this object.
|
Map<String,DbEntity> |
getAdditionalDbEntities()
Returns information about additional db entities that is used for this ObjEntity (i.e.
|
PropertyDescriptor |
getDeclaredProperty(String propertyName)
Returns a Java Bean property descriptor matching property name or null if no such
property is found.
|
ClassDescriptor |
getDescriptor()
Returns underlying descriptor used to delegate all processing, resolving it if
needed.
|
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.
|
PropertyDescriptor |
getProperty(String propertyName)
Returns a property descriptor matching property name, or null if no such property
is found.
|
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 or no inheritance is mapped.
|
boolean |
hasSubclasses()
Returns whether this class has persistent subclasses.
|
void |
injectValueHolders(Object object)
Prepares object properties for access.
|
boolean |
isFault(Object object)
Returns true if an object is not fully resolved.
|
void |
shallowMerge(Object from,
Object to)
Merges object properties from one object to another, avoiding traversal of the
ArcProperties.
|
String |
toString() |
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 descriptor
protected ClassDescriptorMap descriptorMap
protected String entityName
public LazyClassDescriptorDecorator(ClassDescriptorMap descriptorMap, String entityName)
protected void checkDescriptorInitialized()
ClassDescriptorMap
.public ClassDescriptor getDescriptor()
public Object createObject()
ClassDescriptor
createObject
in interface ClassDescriptor
public PropertyDescriptor getDeclaredProperty(String propertyName)
ClassDescriptor
AttributeProperty
,
ToManyProperty
, ToOneProperty
.getDeclaredProperty
in interface ClassDescriptor
public ObjEntity getEntity()
ClassDescriptor
getEntity
in interface ClassDescriptor
public Collection<DbEntity> getRootDbEntities()
ClassDescriptor
getRootDbEntities
in interface ClassDescriptor
public Map<String,DbEntity> getAdditionalDbEntities()
ClassDescriptor
Keys are full paths for corresponding flattened attributes.
getAdditionalDbEntities
in interface ClassDescriptor
public EntityInheritanceTree getEntityInheritanceTree()
getEntityInheritanceTree
in interface ClassDescriptor
public boolean hasSubclasses()
ClassDescriptor
hasSubclasses
in interface ClassDescriptor
public Class<?> getObjectClass()
ClassDescriptor
getObjectClass
in interface ClassDescriptor
public Collection<AttributeProperty> getIdProperties()
ClassDescriptor
getIdProperties
in interface ClassDescriptor
public Collection<ObjAttribute> getDiscriminatorColumns()
ClassDescriptor
getDiscriminatorColumns
in interface ClassDescriptor
public Expression getEntityQualifier()
ClassDescriptor
getEntityQualifier
in interface ClassDescriptor
public Collection<ArcProperty> getMapArcProperties()
ClassDescriptor
arc.getComplimentaryReverseArc() instanceof ToManyMapProperty
getMapArcProperties
in interface ClassDescriptor
public PropertyDescriptor getProperty(String propertyName)
ClassDescriptor
AttributeProperty
,
ToManyProperty
, ToOneProperty
.getProperty
in interface ClassDescriptor
public ClassDescriptor getSubclassDescriptor(Class<?> objectClass)
ClassDescriptor
this.getObjectClass().isAssignableFrom(objectClass)
getSubclassDescriptor
in interface ClassDescriptor
public ClassDescriptor getSuperclassDescriptor()
ClassDescriptor
getSuperclassDescriptor
in interface ClassDescriptor
public void injectValueHolders(Object object) throws PropertyException
ClassDescriptor
injectValueHolders
in interface ClassDescriptor
PropertyException
public boolean isFault(Object object)
ClassDescriptor
isFault
in interface ClassDescriptor
public void shallowMerge(Object from, Object to) throws PropertyException
ClassDescriptor
shallowMerge
in interface ClassDescriptor
PropertyException
public boolean visitDeclaredProperties(PropertyVisitor visitor)
ClassDescriptor
visitDeclaredProperties
in interface ClassDescriptor
public boolean visitProperties(PropertyVisitor visitor)
ClassDescriptor
visitProperties
in interface ClassDescriptor
public boolean visitAllProperties(PropertyVisitor visitor)
ClassDescriptor
visitAllProperties
in interface ClassDescriptor
Copyright © 2001–2019 Apache Cayenne. All rights reserved.