org.kuali.rice.krad.data.provider.util
Class ReferenceLinker
java.lang.Object
org.kuali.rice.krad.data.provider.util.ReferenceLinker
public class ReferenceLinker
- extends Object
Links parent-child object references
Method Summary |
protected DataObjectService |
getDataObjectService()
|
protected MetadataRepository |
getMetadataRepository()
|
protected void |
linkCollections(DataObjectMetadata metadata,
Object persistableObject,
Set<Object> referenceSet)
|
protected void |
linkNonUpdatableChild(DataObjectWrapper<?> parentWrap,
DataObjectWrapper<?> childWrap,
String childObjectPropertyName,
List<DataObjectAttributeRelationship> refAttrs)
|
void |
linkObjects(Object persistableObject)
For each reference object to the parent persistableObject, sets the key
values for that object. |
protected void |
linkObjectsWithCircularReferenceCheck(Object persistableObject,
Set<Object> referenceSet)
|
protected void |
linkRelationships(DataObjectMetadata metadata,
Object persistableObject,
Set<Object> referenceSet)
|
protected void |
linkUpdatableChild(DataObjectWrapper<?> parentWrap,
DataObjectWrapper<?> childWrap,
String childObjectPropertyName,
List<DataObjectAttributeRelationship> refAttrs)
Attempt to ensure that, for an updatable reference object that the FK fields and the reference object remain
consistent. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReferenceLinker
public ReferenceLinker(DataObjectService dataObjectService)
getDataObjectService
protected DataObjectService getDataObjectService()
getMetadataRepository
protected MetadataRepository getMetadataRepository()
linkObjects
public void linkObjects(Object persistableObject)
- For each reference object to the parent persistableObject, sets the key
values for that object. First, if the reference object already has a
value for the key, the value is left unchanged. Otherwise, for
non-anonymous keys, the value is taken from the parent object. For
anonymous keys, all other persistableObjects are checked until a value
for the key is found.
linkObjectsWithCircularReferenceCheck
protected void linkObjectsWithCircularReferenceCheck(Object persistableObject,
Set<Object> referenceSet)
linkRelationships
protected void linkRelationships(DataObjectMetadata metadata,
Object persistableObject,
Set<Object> referenceSet)
linkUpdatableChild
protected void linkUpdatableChild(DataObjectWrapper<?> parentWrap,
DataObjectWrapper<?> childWrap,
String childObjectPropertyName,
List<DataObjectAttributeRelationship> refAttrs)
- Attempt to ensure that, for an updatable reference object that the FK fields and the reference object remain
consistent.
- If the referenced key on the child object is not set and the matching key on the parent is set, set the key
field on the child object.
- Parameters:
parentWrap
- childWrap
- refAttrs
-
linkNonUpdatableChild
protected void linkNonUpdatableChild(DataObjectWrapper<?> parentWrap,
DataObjectWrapper<?> childWrap,
String childObjectPropertyName,
List<DataObjectAttributeRelationship> refAttrs)
linkCollections
protected void linkCollections(DataObjectMetadata metadata,
Object persistableObject,
Set<Object> referenceSet)
Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.