Class BaseToManyProperty
java.lang.Object
org.apache.cayenne.reflect.BaseProperty
org.apache.cayenne.reflect.BaseArcProperty
org.apache.cayenne.reflect.BaseToManyProperty
- All Implemented Interfaces:
ArcProperty, PropertyDescriptor, ToManyProperty
A generic superclass of CollectionProperty implementations.
- Since:
- 1.2
-
Field Summary
Fields inherited from class BaseArcProperty
complimentaryReverseArcName, relationship, reverseDbPath, targetDescriptorModifier and TypeFieldDescriptionprotected Stringprotected ObjRelationshipprotected CayennePathprotected ClassDescriptorFields inherited from class BaseProperty
accessor, owner -
Constructor Summary
ConstructorsConstructorDescriptionBaseToManyProperty(ClassDescriptor owner, ClassDescriptor targetDescriptor, Accessor accessor, String reverseName) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddTargetDirectly(Object source, Object target) Adds value to collection, without triggering changing events This method is mostly for internal useprotected abstract ValueHoldercreateCollectionValueHolder(Object object) Creates a Collection for an object.protected ValueHolderensureCollectionValueHolderSet(Object object) Checks that an object's List field described by this property is set, injecting a List if needed.voidinjectValueHolder(Object object) Injects a List in the object if it hasn't been done yet.readProperty(Object object) Returns a property value, inflating unresolved object if need.voidremoveTarget(Object source, Object target, boolean setReverse) voidremoveTargetDirectly(Object source, Object target) Removes value from collection, without triggering changing events This method is mostly for internal usebooleanvisit(PropertyVisitor visitor) A visitor accept method.voidwritePropertyDirectly(Object object, Object oldValue, Object newValue) Wraps list in a value holder that performs lazy faulting.Methods inherited from class BaseArcProperty
getComplimentaryReverseArc, getComplimentaryReverseDbRelationshipPath, getRelationship, getTargetDescriptor, isFault, setReverseModifier and TypeMethodDescriptionReturns a complimentary reverse ArcProperty or null if no reverse arc exists.Returns a path over reverse DbRelationships for this arc's ObjRelationship.Returns a relationship associated with this arc.Returns a ClassDescriptor for the type of graph nodes pointed to by this arc property.abstract booleanReturns whether a target node connected to a given object is an unresolved fault.protected voidsetReverse(Object source, Object oldTarget, Object newTarget) A convenience method to set the reverse arc used by subclasses.Methods inherited from class BaseProperty
getName, readPropertyDirectly, toString, writePropertyModifier and TypeMethodDescriptiongetName()Returns property name.readPropertyDirectly(Object object) Returns a property value of an object without disturbing the object fault status.toString()voidwriteProperty(Object object, Object oldValue, Object newValue) Sets a property value, inflating unresolved object if need.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ArcProperty
invalidateModifier and TypeMethodDescriptionvoidinvalidate(Object object) Turns a property of an object into a fault.Methods inherited from interface PropertyDescriptor
equals
-
Constructor Details
-
BaseToManyProperty
public BaseToManyProperty(ClassDescriptor owner, ClassDescriptor targetDescriptor, Accessor accessor, String reverseName)
-
-
Method Details
-
readProperty
Description copied from interface:PropertyDescriptorReturns a property value, inflating unresolved object if need.- Specified by:
readPropertyin interfacePropertyDescriptor- Overrides:
readPropertyin classBaseProperty- Throws:
PropertyException
-
writePropertyDirectly
public void writePropertyDirectly(Object object, Object oldValue, Object newValue) throws PropertyException Wraps list in a value holder that performs lazy faulting.- Specified by:
writePropertyDirectlyin interfacePropertyDescriptor- Overrides:
writePropertyDirectlyin classBaseProperty- Throws:
PropertyException
-
addTarget
- Specified by:
addTargetin interfaceToManyProperty
-
addTargetDirectly
Description copied from interface:ToManyPropertyAdds value to collection, without triggering changing events This method is mostly for internal use- Specified by:
addTargetDirectlyin interfaceToManyProperty- Throws:
PropertyException
-
removeTargetDirectly
Description copied from interface:ToManyPropertyRemoves value from collection, without triggering changing events This method is mostly for internal use- Specified by:
removeTargetDirectlyin interfaceToManyProperty- Throws:
PropertyException
-
removeTarget
- Specified by:
removeTargetin interfaceToManyProperty
-
visit
Description copied from interface:PropertyDescriptorA visitor accept method.- Specified by:
visitin interfacePropertyDescriptor- Specified by:
visitin classBaseArcProperty- Returns:
- a status returned by the corresponding callback method of the visitor. It serves as an indication of whether peer properties processing is still needed.
-
injectValueHolder
Injects a List in the object if it hasn't been done yet.- Specified by:
injectValueHolderin interfacePropertyDescriptor- Overrides:
injectValueHolderin classBaseProperty- Throws:
PropertyException
-
ensureCollectionValueHolderSet
Checks that an object's List field described by this property is set, injecting a List if needed.- Throws:
PropertyException
-
createCollectionValueHolder
Creates a Collection for an object.- Throws:
PropertyException
-