Class KRADLegacyDataAdapterImpl

java.lang.Object
org.kuali.rice.krad.service.impl.KRADLegacyDataAdapterImpl
All Implemented Interfaces:
org.kuali.rice.krad.service.LegacyDataAdapter, org.kuali.rice.krad.service.LegacyDataAppAdapter

public class KRADLegacyDataAdapterImpl extends Object implements org.kuali.rice.krad.service.LegacyDataAdapter
  • Constructor Details

    • KRADLegacyDataAdapterImpl

      public KRADLegacyDataAdapterImpl()
  • Method Details

    • save

      public <T> T save(T dataObject)
      Specified by:
      save in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • flush

      public void flush(Class<?> type)
      Specified by:
      flush in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • linkAndSave

      public <T> T linkAndSave(T dataObject)
      Specified by:
      linkAndSave in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • saveDocument

      public <T> T saveDocument(T document)
      Specified by:
      saveDocument in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • findByPrimaryKey

      public <T> T findByPrimaryKey(Class<T> clazz, Map<String,?> primaryKeys)
      Specified by:
      findByPrimaryKey in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • findBySinglePrimaryKey

      public <T> T findBySinglePrimaryKey(Class<T> clazz, Object primaryKey)
      Specified by:
      findBySinglePrimaryKey in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • delete

      public void delete(Object dataObject)
      Specified by:
      delete in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • deleteMatching

      public <T> void deleteMatching(Class<T> type, Map<String,?> fieldValues)
      Specified by:
      deleteMatching in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • retrieve

      public <T> T retrieve(T dataObject)
      Specified by:
      retrieve in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • findAll

      public <T> List<T> findAll(Class<T> clazz)
      Specified by:
      findAll in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • findAll

      public <T> org.kuali.rice.krad.util.QueryPagingResults<T> findAll(Class<T> clazz, org.kuali.rice.krad.util.QueryPagingRequest pagingRequest)
      Specified by:
      findAll in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • findMatching

      public <T> List<T> findMatching(Class<T> clazz, Map<String,?> fieldValues)
      Specified by:
      findMatching in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • findMatching

      public <T> org.kuali.rice.krad.util.QueryPagingResults<T> findMatching(Class<T> clazz, Map<String,?> fieldValues, org.kuali.rice.krad.util.QueryPagingRequest pagingRequest)
      Specified by:
      findMatching in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • findMatchingOrderBy

      public <T> List<T> findMatchingOrderBy(Class<T> clazz, Map<String,?> fieldValues, String sortField, boolean sortAscending)
      Specified by:
      findMatchingOrderBy in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • findMatchingOrderBy

      public <T> org.kuali.rice.krad.util.QueryPagingResults<T> findMatchingOrderBy(Class<T> clazz, Map<String,?> fieldValues, String sortField, boolean sortAscending, org.kuali.rice.krad.util.QueryPagingRequest pagingRequest)
      Specified by:
      findMatchingOrderBy in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • getPrimaryKeyFieldValues

      public Map<String,?> getPrimaryKeyFieldValues(Object dataObject)
      Specified by:
      getPrimaryKeyFieldValues in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • retrieveNonKeyFields

      public void retrieveNonKeyFields(Object persistableObject)
      Specified by:
      retrieveNonKeyFields in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • retrieveReferenceObject

      public void retrieveReferenceObject(Object persistableObject, String referenceObjectName)
      Specified by:
      retrieveReferenceObject in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • refreshAllNonUpdatingReferences

      public void refreshAllNonUpdatingReferences(Object persistableObject)
      Specified by:
      refreshAllNonUpdatingReferences in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • findNonUpdateableRelationships

      protected List<org.kuali.rice.krad.data.metadata.DataObjectRelationship> findNonUpdateableRelationships(Object persistableObject)
    • isProxied

      public boolean isProxied(Object object)
      Specified by:
      isProxied in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • resolveProxy

      public Object resolveProxy(Object o)
      Specified by:
      resolveProxy in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • findCollectionBySearchHelper

      public <T> Collection<T> findCollectionBySearchHelper(Class<T> dataObjectClass, Map<String,String> formProperties, boolean unbounded, boolean allPrimaryKeyValuesPresentAndNotWildcard, Integer searchResultsLimit)
      Specified by:
      findCollectionBySearchHelper in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • findCollectionBySearchHelper

      public <T> Collection<T> findCollectionBySearchHelper(Class<T> dataObjectClass, Map<String,String> formProperties, List<String> wildcardAsLiteralPropertyNames, boolean unbounded, boolean allPrimaryKeyValuesPresentAndNotWildcard, Integer searchResultsLimit)
      Specified by:
      findCollectionBySearchHelper in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • performDataObjectServiceLookup

      protected <T> Collection<T> performDataObjectServiceLookup(Class<T> dataObjectClass, Map<String,String> formProperties, boolean unbounded, boolean allPrimaryKeyValuesPresentAndNotWildcard, Integer searchResultsLimit)
      Our new DataObjectService-based lookup implementation
      Type Parameters:
      T - the data object type
      Parameters:
      dataObjectClass - the dataobject class
      formProperties - the incoming lookup form properties
      unbounded - whether the search is unbounded
      searchResultsLimit - the searchResultsLimit; null implies use of default KNS value if set for the class
      Returns:
      collection of lookup results
    • performDataObjectServiceLookup

      protected <T> Collection<T> performDataObjectServiceLookup(Class<T> dataObjectClass, Map<String,String> formProperties, List<String> wildcardAsLiteralPropertyNames, boolean unbounded, boolean allPrimaryKeyValuesPresentAndNotWildcard, Integer searchResultsLimit)
      Our newer DataObjectService-based lookup implementation
      Type Parameters:
      T - the data object type
      Parameters:
      dataObjectClass - the dataobject class
      formProperties - the incoming lookup form properties
      wildcardAsLiteralPropertyNames - list of the lookup properties with wildcard characters disabled
      unbounded - whether the search is unbounded
      searchResultsLimit - the searchResultsLimit; null implies use of default KNS value if set for the class
      Returns:
      collection of lookup results
    • filterCurrentDataObjects

      protected <T> Collection<T> filterCurrentDataObjects(Class<T> dataObjectClass, Collection<T> unfiltered, Map<String,String> formProps)
    • lookupCriteriaCurrentSpecifier

      protected Boolean lookupCriteriaCurrentSpecifier(Map<String,String> formProps)
    • findObjectBySearch

      public <T> T findObjectBySearch(Class<T> type, Map<String,String> formProps)
      Specified by:
      findObjectBySearch in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • allPrimaryKeyValuesPresentAndNotWildcard

      public boolean allPrimaryKeyValuesPresentAndNotWildcard(Class<?> boClass, Map<String,String> formProps)
      Returns whether all primary key values are specified in the lookup map and do not contain any wildcards
      Specified by:
      allPrimaryKeyValuesPresentAndNotWildcard in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
      Parameters:
      boClass - the bo class to lookup
      formProps - the incoming form/lookup properties
      Returns:
      whether all primary key values are specified in the lookup map and do not contain any wildcards
    • listPrimaryKeyFieldNames

      public List<String> listPrimaryKeyFieldNames(Class<?> type)
      Specified by:
      listPrimaryKeyFieldNames in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • listPrimaryKeyFieldNamesConsultingAllServices

      protected List<String> listPrimaryKeyFieldNamesConsultingAllServices(Class<?> type)
      LookupServiceImpl calls BusinessObjectMetaDataService to listPrimaryKeyFieldNames. The BusinessObjectMetaDataService goes beyond the PersistenceStructureService to consult the associated ModuleService in determining the primary key field names. TODO: Do we need both listPrimaryKeyFieldNames/persistenceStructureService and listPrimaryKeyFieldNamesConsultingAllServices/businesObjectMetaDataService or can the latter superset be used for the former?
      Parameters:
      type - the data object class
      Returns:
      list of primary key field names, consulting persistence structure service, module service and datadictionary
    • determineCollectionObjectType

      public Class<?> determineCollectionObjectType(Class<?> containingType, String collectionPropertyName)
      Specified by:
      determineCollectionObjectType in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • hasReference

      public boolean hasReference(Class<?> boClass, String referenceName)
      Specified by:
      hasReference in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • hasCollection

      public boolean hasCollection(Class<?> boClass, String collectionName)
      Specified by:
      hasCollection in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • isExtensionAttribute

      public boolean isExtensionAttribute(Class<?> boClass, String attributePropertyName, Class<?> propertyType)
      Specified by:
      isExtensionAttribute in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • getExtensionAttributeClass

      public Class<?> getExtensionAttributeClass(Class<?> boClass, String attributePropertyName)
      Specified by:
      getExtensionAttributeClass in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • getPrimaryKeyFieldValuesDOMDS

      public Map<String,?> getPrimaryKeyFieldValuesDOMDS(Object dataObject)
      Specified by:
      getPrimaryKeyFieldValuesDOMDS in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • equalsByPrimaryKeys

      public boolean equalsByPrimaryKeys(Object do1, Object do2)
      Specified by:
      equalsByPrimaryKeys in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • materializeAllSubObjects

      public void materializeAllSubObjects(Object object)
      Specified by:
      materializeAllSubObjects in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • getPropertyType

      public Class<?> getPropertyType(Object object, String propertyName)
      Recursively calls getPropertyTypeChild if nested property to allow it to properly look it up
      Specified by:
      getPropertyType in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • getExtension

      public Object getExtension(Class<?> businessObjectClass) throws InstantiationException, IllegalAccessException
      Specified by:
      getExtension in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
      Throws:
      InstantiationException
      IllegalAccessException
    • refreshReferenceObject

      public void refreshReferenceObject(Object businessObject, String referenceObjectName)
      Specified by:
      refreshReferenceObject in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • isLockable

      public boolean isLockable(Object object)
      Specified by:
      isLockable in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • verifyVersionNumber

      public void verifyVersionNumber(Object dataObject)
      Specified by:
      verifyVersionNumber in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • createQuickFinder

      public org.kuali.rice.core.api.uif.RemotableQuickFinder.Builder createQuickFinder(Class<?> containingClass, String attributeName)
      Specified by:
      createQuickFinder in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • createQuickFinderNew

      protected org.kuali.rice.core.api.uif.RemotableQuickFinder.Builder createQuickFinderNew(Class<?> containingClass, String attributeName)
      New implementation of createQuickFinder which uses the new dataObjectService.getMetadataRepository().
    • isReferenceUpdatable

      public boolean isReferenceUpdatable(Class<?> type, String referenceName)
      Specified by:
      isReferenceUpdatable in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • listReferenceObjectFields

      public Map<String,Class<?>> listReferenceObjectFields(Class<?> type)
      Specified by:
      listReferenceObjectFields in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • isCollectionUpdatable

      public boolean isCollectionUpdatable(Class<?> type, String collectionName)
      Specified by:
      isCollectionUpdatable in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • listCollectionObjectTypes

      public Map<String,Class<?>> listCollectionObjectTypes(Class<?> type)
      Specified by:
      listCollectionObjectTypes in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • getReferenceIfExists

      public Object getReferenceIfExists(Object bo, String referenceName)
      Specified by:
      getReferenceIfExists in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • allForeignKeyValuesPopulatedForReference

      public boolean allForeignKeyValuesPopulatedForReference(Object bo, String referenceName)
      Specified by:
      allForeignKeyValuesPopulatedForReference in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • getDictionaryRelationship

      public org.kuali.rice.krad.datadictionary.RelationshipDefinition getDictionaryRelationship(Class<?> c, String attributeName)
      gets the relationship that the attribute represents on the class
      Specified by:
      getDictionaryRelationship in interface org.kuali.rice.krad.service.LegacyDataAdapter
      Parameters:
      c - - the class to which the attribute belongs
      attributeName - - property name for the attribute
      Returns:
      a relationship definition for the attribute
    • getTitleAttribute

      public String getTitleAttribute(Class<?> dataObjectClass)
      Specified by:
      getTitleAttribute in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • getDataObjectEntry

      protected org.kuali.rice.krad.datadictionary.DataObjectEntry getDataObjectEntry(Class<?> dataObjectClass)
      Returns:
      DataObjectEntry for the given dataObjectClass, or null if there is none
      Throws:
      IllegalArgumentException - if the given Class is null
    • areNotesSupported

      public boolean areNotesSupported(Class<?> dataObjectClass)
      Specified by:
      areNotesSupported in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • getPrimaryKeyFieldValues

      public Map<String,?> getPrimaryKeyFieldValues(Object dataObject, boolean sortFieldNames)
      Grabs primary key fields and sorts them if sort field names is true
      Returns:
      Map of sorted primary key field values
    • getDataObjectIdentifierString

      public String getDataObjectIdentifierString(Object dataObject)
      Specified by:
      getDataObjectIdentifierString in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • getInquiryObjectClassIfNotTitle

      public Class<?> getInquiryObjectClassIfNotTitle(Object dataObject, String propertyName)
      Specified by:
      getInquiryObjectClassIfNotTitle in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • getInquiryParameters

      public Map<String,String> getInquiryParameters(Object dataObject, List<String> keys, String propertyName)
      Specified by:
      getInquiryParameters in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • hasLocalLookup

      public boolean hasLocalLookup(Class<?> dataObjectClass)
      Specified by:
      hasLocalLookup in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • hasLocalInquiry

      public boolean hasLocalInquiry(Class<?> dataObjectClass)
      Specified by:
      hasLocalInquiry in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • getDataObjectRelationship

      public org.kuali.rice.krad.bo.DataObjectRelationship getDataObjectRelationship(Object dataObject, Class<?> dataObjectClass, String attributeName, String attributePrefix, boolean keysOnly, boolean supportsLookup, boolean supportsInquiry)
      Specified by:
      getDataObjectRelationship in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • transformToDeprecatedDataObjectRelationship

      protected org.kuali.rice.krad.bo.DataObjectRelationship transformToDeprecatedDataObjectRelationship(Class<?> dataObjectClass, String attributeName, String attributePrefix, Class<?> relatedObjectClass, org.kuali.rice.krad.data.metadata.DataObjectAttributeRelationship relationship)
    • populateRelationshipFromDictionaryReference

      protected org.kuali.rice.krad.bo.DataObjectRelationship populateRelationshipFromDictionaryReference(Class<?> dataObjectClass, org.kuali.rice.krad.datadictionary.RelationshipDefinition ddReference, String attributePrefix, boolean keysOnly)
    • isPersistable

      public boolean isPersistable(Class<?> dataObjectClass)
      Specified by:
      isPersistable in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • getRelationshipMetadata

      protected org.kuali.rice.krad.bo.DataObjectRelationship getRelationshipMetadata(Class<?> dataObjectClass, String attributeName, String attributePrefix)
    • classHasSupportedFeatures

      protected boolean classHasSupportedFeatures(Class<?> relationshipClass, boolean supportsLookup, boolean supportsInquiry)
    • getForeignKeyFieldsPopulationState

      public org.kuali.rice.krad.util.ForeignKeyFieldsPopulationState getForeignKeyFieldsPopulationState(Object dataObject, String referenceName)
      Specified by:
      getForeignKeyFieldsPopulationState in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • getForeignKeysForReference

      public Map<String,String> getForeignKeysForReference(Class<?> clazz, String attributeName)
      Specified by:
      getForeignKeysForReference in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • setObjectPropertyDeep

      public <T> void setObjectPropertyDeep(Object bo, String propertyName, Class<T> type, T propertyValue) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
      Specified by:
      setObjectPropertyDeep in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
      Throws:
      IllegalAccessException
      InvocationTargetException
      NoSuchMethodException
    • hasPrimaryKeyFieldValues

      public boolean hasPrimaryKeyFieldValues(Object dataObject)
      Specified by:
      hasPrimaryKeyFieldValues in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • materializeClassForProxiedObject

      public <T> Class<T> materializeClassForProxiedObject(T object)
      Specified by:
      materializeClassForProxiedObject in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • getNestedValue

      public Object getNestedValue(Object bo, String fieldName)
      Specified by:
      getNestedValue in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • createNewObjectFromClass

      public <T> T createNewObjectFromClass(Class<T> clazz)
      Specified by:
      createNewObjectFromClass in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • isNull

      public boolean isNull(Object object)
      Specified by:
      isNull in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
    • setObjectProperty

      public <T> void setObjectProperty(Object bo, String propertyName, Class<T> propertyType, T propertyValue) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
      Specified by:
      setObjectProperty in interface org.kuali.rice.krad.service.LegacyDataAppAdapter
      Throws:
      IllegalAccessException
      InvocationTargetException
      NoSuchMethodException
    • findByDocumentHeaderId

      public <T extends org.kuali.rice.krad.document.Document> T findByDocumentHeaderId(Class<T> documentClass, String id)
      Specified by:
      findByDocumentHeaderId in interface org.kuali.rice.krad.service.LegacyDataAdapter
    • findByDocumentHeaderIds

      public <T extends org.kuali.rice.krad.document.Document> List<T> findByDocumentHeaderIds(Class<T> documentClass, List<String> ids)
      Specified by:
      findByDocumentHeaderIds in interface org.kuali.rice.krad.service.LegacyDataAdapter
    • setDataObjectService

      public void setDataObjectService(org.kuali.rice.krad.data.DataObjectService dataObjectService)
    • setLookupCriteriaGenerator

      public void setLookupCriteriaGenerator(org.kuali.rice.krad.service.impl.LookupCriteriaGenerator lookupCriteriaGenerator)
    • setKualiConfigurationService

      public void setKualiConfigurationService(org.kuali.rice.core.api.config.property.ConfigurationService kualiConfigurationService)
    • setKualiModuleService

      public void setKualiModuleService(org.kuali.rice.krad.service.KualiModuleService kualiModuleService)
    • setDataDictionaryService

      public void setDataDictionaryService(org.kuali.rice.krad.service.DataDictionaryService dataDictionaryService)
    • getViewDictionaryService

      public org.kuali.rice.krad.uif.service.ViewDictionaryService getViewDictionaryService()
    • setViewDictionaryService

      public void setViewDictionaryService(org.kuali.rice.krad.uif.service.ViewDictionaryService viewDictionaryService)
    • getDataObjectService

      public org.kuali.rice.krad.data.DataObjectService getDataObjectService()
    • getLookupCriteriaGenerator

      public org.kuali.rice.krad.service.impl.LookupCriteriaGenerator getLookupCriteriaGenerator()
    • getKualiConfigurationService

      public org.kuali.rice.core.api.config.property.ConfigurationService getKualiConfigurationService()
    • getKualiModuleService

      public org.kuali.rice.krad.service.KualiModuleService getKualiModuleService()
    • getDataDictionaryService

      public org.kuali.rice.krad.service.DataDictionaryService getDataDictionaryService()
    • getInactivateableFromToService

      public org.kuali.rice.krad.service.InactivateableFromToService getInactivateableFromToService()
    • setInactivateableFromToService

      public void setInactivateableFromToService(org.kuali.rice.krad.service.InactivateableFromToService inactivateableFromToService)
    • getDocumentAdHocService

      public org.kuali.rice.krad.service.DocumentAdHocService getDocumentAdHocService()
    • setDocumentAdHocService

      public void setDocumentAdHocService(org.kuali.rice.krad.service.DocumentAdHocService documentAdHocService)