Package org.apache.cayenne.reflect
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 org.apache.cayenne.reflect.BaseArcProperty
complimentaryReverseArcName, relationship, reverseDbPath, targetDescriptor
Fields inherited from class org.apache.cayenne.reflect.BaseProperty
accessor, owner
-
Constructor Summary
ConstructorDescriptionBaseToManyProperty
(ClassDescriptor owner, ClassDescriptor targetDescriptor, Accessor accessor, String reverseName) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addTargetDirectly
(Object source, Object target) Adds value to collection, without triggering changing events This method is mostly for internal useprotected abstract ValueHolder
createCollectionValueHolder
(Object object) Creates a Collection for an object.protected ValueHolder
ensureCollectionValueHolderSet
(Object object) Checks that an object's List field described by this property is set, injecting a List if needed.void
injectValueHolder
(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.void
removeTarget
(Object source, Object target, boolean setReverse) void
removeTargetDirectly
(Object source, Object target) Removes value from collection, without triggering changing events This method is mostly for internal useboolean
visit
(PropertyVisitor visitor) A visitor accept method.void
writePropertyDirectly
(Object object, Object oldValue, Object newValue) Wraps list in a value holder that performs lazy faulting.Methods inherited from class org.apache.cayenne.reflect.BaseArcProperty
getComplimentaryReverseArc, getComplimentaryReverseDbRelationshipPath, getRelationship, getTargetDescriptor, isFault, setReverse
Methods inherited from class org.apache.cayenne.reflect.BaseProperty
getName, readPropertyDirectly, toString, writeProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.cayenne.reflect.ArcProperty
getComplimentaryReverseArc, getComplimentaryReverseDbRelationshipPath, getRelationship, getTargetDescriptor, invalidate, isFault
Methods inherited from interface org.apache.cayenne.reflect.PropertyDescriptor
equals, getName, readPropertyDirectly, writeProperty
-
Constructor Details
-
BaseToManyProperty
public BaseToManyProperty(ClassDescriptor owner, ClassDescriptor targetDescriptor, Accessor accessor, String reverseName)
-
-
Method Details
-
readProperty
Description copied from interface:PropertyDescriptor
Returns a property value, inflating unresolved object if need.- Specified by:
readProperty
in interfacePropertyDescriptor
- Overrides:
readProperty
in 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:
writePropertyDirectly
in interfacePropertyDescriptor
- Overrides:
writePropertyDirectly
in classBaseProperty
- Throws:
PropertyException
-
addTarget
- Specified by:
addTarget
in interfaceToManyProperty
-
addTargetDirectly
Description copied from interface:ToManyProperty
Adds value to collection, without triggering changing events This method is mostly for internal use- Specified by:
addTargetDirectly
in interfaceToManyProperty
- Throws:
PropertyException
-
removeTargetDirectly
Description copied from interface:ToManyProperty
Removes value from collection, without triggering changing events This method is mostly for internal use- Specified by:
removeTargetDirectly
in interfaceToManyProperty
- Throws:
PropertyException
-
removeTarget
- Specified by:
removeTarget
in interfaceToManyProperty
-
visit
Description copied from interface:PropertyDescriptor
A visitor accept method.- Specified by:
visit
in interfacePropertyDescriptor
- Specified by:
visit
in 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:
injectValueHolder
in interfacePropertyDescriptor
- Overrides:
injectValueHolder
in 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
-