org.kuali.rice.krad.data.provider.util
Class ReferenceLinker

java.lang.Object
  extended by org.kuali.rice.krad.data.provider.util.ReferenceLinker

public class ReferenceLinker
extends Object

Links parent-child object references


Constructor Summary
ReferenceLinker(DataObjectService dataObjectService)
           
 
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
 

Constructor Detail

ReferenceLinker

public ReferenceLinker(DataObjectService dataObjectService)
Method Detail

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.
  1. 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.