Package org.kuali.rice.krad.service.impl
Class KRADLegacyDataAdapterImpl
java.lang.Object
org.kuali.rice.krad.service.impl.KRADLegacyDataAdapterImpl
- All Implemented Interfaces:
LegacyDataAdapter,LegacyDataAppAdapter
-
Field Summary
Fields inherited from interface org.kuali.rice.krad.service.LegacyDataAdapter
CLASS_NOT_PERSISTABLE_OJB_EXCEPTION_CLASS, OPTIMISTIC_LOCK_OJB_EXCEPTION_CLASS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallForeignKeyValuesPopulatedForReference(Object bo, String referenceName) booleanallPrimaryKeyValuesPresentAndNotWildcard(Class<?> boClass, Map<String, String> formProps) Returns whether all primary key values are specified in the lookup map and do not contain any wildcardsbooleanareNotesSupported(Class<?> dataObjectClass) protected booleanclassHasSupportedFeatures(Class<?> relationshipClass, boolean supportsLookup, boolean supportsInquiry) <T> TcreateNewObjectFromClass(Class<T> clazz) org.kuali.rice.core.api.uif.RemotableQuickFinder.BuildercreateQuickFinder(Class<?> containingClass, String attributeName) protected org.kuali.rice.core.api.uif.RemotableQuickFinder.BuildercreateQuickFinderNew(Class<?> containingClass, String attributeName) New implementation of createQuickFinder which uses the new dataObjectService.getMetadataRepository().void<T> voiddeleteMatching(Class<T> type, Map<String, ?> fieldValues) Class<?> determineCollectionObjectType(Class<?> containingType, String collectionPropertyName) booleanequalsByPrimaryKeys(Object do1, Object do2) protected <T> Collection<T> filterCurrentDataObjects(Class<T> dataObjectClass, Collection<T> unfiltered, Map<String, String> formProps) <T> List<T> <T> QueryPagingResults<T> findAll(Class<T> clazz, QueryPagingRequest pagingRequest) <T extends Document>
TfindByDocumentHeaderId(Class<T> documentClass, String id) findByDocumentHeaderIds(Class<T> documentClass, List<String> ids) <T> TfindByPrimaryKey(Class<T> clazz, Map<String, ?> primaryKeys) <T> TfindBySinglePrimaryKey(Class<T> clazz, Object primaryKey) <T> Collection<T> findCollectionBySearchHelper(Class<T> dataObjectClass, Map<String, String> formProperties, boolean unbounded, boolean allPrimaryKeyValuesPresentAndNotWildcard, Integer searchResultsLimit) <T> Collection<T> findCollectionBySearchHelper(Class<T> dataObjectClass, Map<String, String> formProperties, List<String> wildcardAsLiteralPropertyNames, boolean unbounded, boolean allPrimaryKeyValuesPresentAndNotWildcard, Integer searchResultsLimit) <T> List<T> findMatching(Class<T> clazz, Map<String, ?> fieldValues) <T> QueryPagingResults<T> findMatching(Class<T> clazz, Map<String, ?> fieldValues, QueryPagingRequest pagingRequest) <T> List<T> findMatchingOrderBy(Class<T> clazz, Map<String, ?> fieldValues, String sortField, boolean sortAscending) <T> QueryPagingResults<T> findMatchingOrderBy(Class<T> clazz, Map<String, ?> fieldValues, String sortField, boolean sortAscending, QueryPagingRequest pagingRequest) protected List<org.kuali.rice.krad.data.metadata.DataObjectRelationship> findNonUpdateableRelationships(Object persistableObject) <T> TfindObjectBySearch(Class<T> type, Map<String, String> formProps) voidprotected DataObjectEntrygetDataObjectEntry(Class<?> dataObjectClass) getDataObjectIdentifierString(Object dataObject) getDataObjectRelationship(Object dataObject, Class<?> dataObjectClass, String attributeName, String attributePrefix, boolean keysOnly, boolean supportsLookup, boolean supportsInquiry) org.kuali.rice.krad.data.DataObjectServicegetDictionaryRelationship(Class<?> c, String attributeName) gets the relationship that the attribute represents on the classgetExtension(Class<?> businessObjectClass) Class<?> getExtensionAttributeClass(Class<?> boClass, String attributePropertyName) getForeignKeyFieldsPopulationState(Object dataObject, String referenceName) getForeignKeysForReference(Class<?> clazz, String attributeName) Class<?> getInquiryObjectClassIfNotTitle(Object dataObject, String propertyName) getInquiryParameters(Object dataObject, List<String> keys, String propertyName) org.kuali.rice.core.api.config.property.ConfigurationServicegetNestedValue(Object bo, String fieldName) getPrimaryKeyFieldValues(Object dataObject) getPrimaryKeyFieldValues(Object dataObject, boolean sortFieldNames) Grabs primary key fields and sorts them if sort field names is truegetPrimaryKeyFieldValuesDOMDS(Object dataObject) Class<?> getPropertyType(Object object, String propertyName) Recursively calls getPropertyTypeChild if nested property to allow it to properly look it upgetReferenceIfExists(Object bo, String referenceName) protected DataObjectRelationshipgetRelationshipMetadata(Class<?> dataObjectClass, String attributeName, String attributePrefix) getTitleAttribute(Class<?> dataObjectClass) booleanhasCollection(Class<?> boClass, String collectionName) booleanhasLocalInquiry(Class<?> dataObjectClass) booleanhasLocalLookup(Class<?> dataObjectClass) booleanhasPrimaryKeyFieldValues(Object dataObject) booleanhasReference(Class<?> boClass, String referenceName) booleanisCollectionUpdatable(Class<?> type, String collectionName) booleanisExtensionAttribute(Class<?> boClass, String attributePropertyName, Class<?> propertyType) booleanisLockable(Object object) booleanbooleanisPersistable(Class<?> dataObjectClass) booleanbooleanisReferenceUpdatable(Class<?> type, String referenceName) <T> TlinkAndSave(T dataObject) listCollectionObjectTypes(Class<?> type) listPrimaryKeyFieldNames(Class<?> type) LookupServiceImpl calls BusinessObjectMetaDataService to listPrimaryKeyFieldNames.listReferenceObjectFields(Class<?> type) protected BooleanlookupCriteriaCurrentSpecifier(Map<String, String> formProps) voidmaterializeAllSubObjects(Object object) <T> Class<T> materializeClassForProxiedObject(T object) protected <T> Collection<T> performDataObjectServiceLookup(Class<T> dataObjectClass, Map<String, String> formProperties, boolean unbounded, boolean allPrimaryKeyValuesPresentAndNotWildcard, Integer searchResultsLimit) Our new DataObjectService-based lookup implementationprotected <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 implementationprotected DataObjectRelationshippopulateRelationshipFromDictionaryReference(Class<?> dataObjectClass, RelationshipDefinition ddReference, String attributePrefix, boolean keysOnly) voidrefreshAllNonUpdatingReferences(Object persistableObject) voidrefreshReferenceObject(Object businessObject, String referenceObjectName) <T> Tretrieve(T dataObject) voidretrieveNonKeyFields(Object persistableObject) voidretrieveReferenceObject(Object persistableObject, String referenceObjectName) <T> Tsave(T dataObject) <T> TsaveDocument(T document) voidsetDataDictionaryService(DataDictionaryService dataDictionaryService) voidsetDataObjectService(org.kuali.rice.krad.data.DataObjectService dataObjectService) voidsetDocumentAdHocService(DocumentAdHocService documentAdHocService) voidsetInactivateableFromToService(InactivateableFromToService inactivateableFromToService) voidsetKualiConfigurationService(org.kuali.rice.core.api.config.property.ConfigurationService kualiConfigurationService) voidsetKualiModuleService(KualiModuleService kualiModuleService) voidsetLookupCriteriaGenerator(LookupCriteriaGenerator lookupCriteriaGenerator) <T> voidsetObjectProperty(Object bo, String propertyName, Class<T> propertyType, T propertyValue) <T> voidsetObjectPropertyDeep(Object bo, String propertyName, Class<T> type, T propertyValue) voidsetViewDictionaryService(ViewDictionaryService viewDictionaryService) protected DataObjectRelationshiptransformToDeprecatedDataObjectRelationship(Class<?> dataObjectClass, String attributeName, String attributePrefix, Class<?> relatedObjectClass, org.kuali.rice.krad.data.metadata.DataObjectAttributeRelationship relationship) voidverifyVersionNumber(Object dataObject)
-
Constructor Details
-
KRADLegacyDataAdapterImpl
public KRADLegacyDataAdapterImpl()
-
-
Method Details
-
save
public <T> T save(T dataObject) - Specified by:
savein interfaceLegacyDataAppAdapter
-
flush
- Specified by:
flushin interfaceLegacyDataAppAdapter
-
linkAndSave
public <T> T linkAndSave(T dataObject) - Specified by:
linkAndSavein interfaceLegacyDataAppAdapter
-
saveDocument
public <T> T saveDocument(T document) - Specified by:
saveDocumentin interfaceLegacyDataAppAdapter
-
findByPrimaryKey
- Specified by:
findByPrimaryKeyin interfaceLegacyDataAppAdapter
-
findBySinglePrimaryKey
- Specified by:
findBySinglePrimaryKeyin interfaceLegacyDataAppAdapter
-
delete
- Specified by:
deletein interfaceLegacyDataAppAdapter
-
deleteMatching
- Specified by:
deleteMatchingin interfaceLegacyDataAppAdapter
-
retrieve
public <T> T retrieve(T dataObject) - Specified by:
retrievein interfaceLegacyDataAppAdapter
-
findAll
- Specified by:
findAllin interfaceLegacyDataAppAdapter
-
findAll
- Specified by:
findAllin interfaceLegacyDataAppAdapter
-
findMatching
- Specified by:
findMatchingin interfaceLegacyDataAppAdapter
-
findMatching
public <T> QueryPagingResults<T> findMatching(Class<T> clazz, Map<String, ?> fieldValues, QueryPagingRequest pagingRequest) - Specified by:
findMatchingin interfaceLegacyDataAppAdapter
-
findMatchingOrderBy
public <T> List<T> findMatchingOrderBy(Class<T> clazz, Map<String, ?> fieldValues, String sortField, boolean sortAscending) - Specified by:
findMatchingOrderByin interfaceLegacyDataAppAdapter
-
findMatchingOrderBy
public <T> QueryPagingResults<T> findMatchingOrderBy(Class<T> clazz, Map<String, ?> fieldValues, String sortField, boolean sortAscending, QueryPagingRequest pagingRequest) - Specified by:
findMatchingOrderByin interfaceLegacyDataAppAdapter
-
getPrimaryKeyFieldValues
- Specified by:
getPrimaryKeyFieldValuesin interfaceLegacyDataAppAdapter
-
retrieveNonKeyFields
- Specified by:
retrieveNonKeyFieldsin interfaceLegacyDataAppAdapter
-
retrieveReferenceObject
- Specified by:
retrieveReferenceObjectin interfaceLegacyDataAppAdapter
-
refreshAllNonUpdatingReferences
- Specified by:
refreshAllNonUpdatingReferencesin interfaceLegacyDataAppAdapter
-
findNonUpdateableRelationships
-
isProxied
- Specified by:
isProxiedin interfaceLegacyDataAppAdapter
-
resolveProxy
- Specified by:
resolveProxyin interfaceLegacyDataAppAdapter
-
findCollectionBySearchHelper
public <T> Collection<T> findCollectionBySearchHelper(Class<T> dataObjectClass, Map<String, String> formProperties, boolean unbounded, boolean allPrimaryKeyValuesPresentAndNotWildcard, Integer searchResultsLimit) - Specified by:
findCollectionBySearchHelperin interfaceLegacyDataAppAdapter
-
findCollectionBySearchHelper
public <T> Collection<T> findCollectionBySearchHelper(Class<T> dataObjectClass, Map<String, String> formProperties, List<String> wildcardAsLiteralPropertyNames, boolean unbounded, boolean allPrimaryKeyValuesPresentAndNotWildcard, Integer searchResultsLimit) - Specified by:
findCollectionBySearchHelperin interfaceLegacyDataAppAdapter
-
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 classformProperties- the incoming lookup form propertiesunbounded- whether the search is unboundedsearchResultsLimit- 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 classformProperties- the incoming lookup form propertieswildcardAsLiteralPropertyNames- list of the lookup properties with wildcard characters disabledunbounded- whether the search is unboundedsearchResultsLimit- 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
-
findObjectBySearch
- Specified by:
findObjectBySearchin interfaceLegacyDataAppAdapter
-
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:
allPrimaryKeyValuesPresentAndNotWildcardin interfaceLegacyDataAppAdapter- Parameters:
boClass- the bo class to lookupformProps- the incoming form/lookup properties- Returns:
- whether all primary key values are specified in the lookup map and do not contain any wildcards
-
listPrimaryKeyFieldNames
- Specified by:
listPrimaryKeyFieldNamesin interfaceLegacyDataAppAdapter
-
listPrimaryKeyFieldNamesConsultingAllServices
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:
determineCollectionObjectTypein interfaceLegacyDataAppAdapter
-
hasReference
- Specified by:
hasReferencein interfaceLegacyDataAppAdapter
-
hasCollection
- Specified by:
hasCollectionin interfaceLegacyDataAppAdapter
-
isExtensionAttribute
public boolean isExtensionAttribute(Class<?> boClass, String attributePropertyName, Class<?> propertyType) - Specified by:
isExtensionAttributein interfaceLegacyDataAppAdapter
-
getExtensionAttributeClass
- Specified by:
getExtensionAttributeClassin interfaceLegacyDataAppAdapter
-
getPrimaryKeyFieldValuesDOMDS
- Specified by:
getPrimaryKeyFieldValuesDOMDSin interfaceLegacyDataAppAdapter
-
equalsByPrimaryKeys
- Specified by:
equalsByPrimaryKeysin interfaceLegacyDataAppAdapter
-
materializeAllSubObjects
- Specified by:
materializeAllSubObjectsin interfaceLegacyDataAppAdapter
-
getPropertyType
Recursively calls getPropertyTypeChild if nested property to allow it to properly look it up- Specified by:
getPropertyTypein interfaceLegacyDataAppAdapter
-
getExtension
public Object getExtension(Class<?> businessObjectClass) throws InstantiationException, IllegalAccessException - Specified by:
getExtensionin interfaceLegacyDataAppAdapter- Throws:
InstantiationExceptionIllegalAccessException
-
refreshReferenceObject
- Specified by:
refreshReferenceObjectin interfaceLegacyDataAppAdapter
-
isLockable
- Specified by:
isLockablein interfaceLegacyDataAppAdapter
-
verifyVersionNumber
- Specified by:
verifyVersionNumberin interfaceLegacyDataAppAdapter
-
createQuickFinder
public org.kuali.rice.core.api.uif.RemotableQuickFinder.Builder createQuickFinder(Class<?> containingClass, String attributeName) - Specified by:
createQuickFinderin interfaceLegacyDataAppAdapter
-
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
- Specified by:
isReferenceUpdatablein interfaceLegacyDataAppAdapter
-
listReferenceObjectFields
- Specified by:
listReferenceObjectFieldsin interfaceLegacyDataAppAdapter
-
isCollectionUpdatable
- Specified by:
isCollectionUpdatablein interfaceLegacyDataAppAdapter
-
listCollectionObjectTypes
- Specified by:
listCollectionObjectTypesin interfaceLegacyDataAppAdapter
-
getReferenceIfExists
- Specified by:
getReferenceIfExistsin interfaceLegacyDataAppAdapter
-
allForeignKeyValuesPopulatedForReference
- Specified by:
allForeignKeyValuesPopulatedForReferencein interfaceLegacyDataAppAdapter
-
getDictionaryRelationship
gets the relationship that the attribute represents on the class- Specified by:
getDictionaryRelationshipin interfaceLegacyDataAdapter- Parameters:
c- - the class to which the attribute belongsattributeName- - property name for the attribute- Returns:
- a relationship definition for the attribute
-
getTitleAttribute
- Specified by:
getTitleAttributein interfaceLegacyDataAppAdapter
-
getDataObjectEntry
- Returns:
- DataObjectEntry for the given dataObjectClass, or null if there is none
- Throws:
IllegalArgumentException- if the given Class is null
-
areNotesSupported
- Specified by:
areNotesSupportedin interfaceLegacyDataAppAdapter
-
getPrimaryKeyFieldValues
Grabs primary key fields and sorts them if sort field names is true- Returns:
- Map of sorted primary key field values
-
getDataObjectIdentifierString
- Specified by:
getDataObjectIdentifierStringin interfaceLegacyDataAppAdapter
-
getInquiryObjectClassIfNotTitle
- Specified by:
getInquiryObjectClassIfNotTitlein interfaceLegacyDataAppAdapter
-
getInquiryParameters
public Map<String,String> getInquiryParameters(Object dataObject, List<String> keys, String propertyName) - Specified by:
getInquiryParametersin interfaceLegacyDataAppAdapter
-
hasLocalLookup
- Specified by:
hasLocalLookupin interfaceLegacyDataAppAdapter
-
hasLocalInquiry
- Specified by:
hasLocalInquiryin interfaceLegacyDataAppAdapter
-
getDataObjectRelationship
public DataObjectRelationship getDataObjectRelationship(Object dataObject, Class<?> dataObjectClass, String attributeName, String attributePrefix, boolean keysOnly, boolean supportsLookup, boolean supportsInquiry) - Specified by:
getDataObjectRelationshipin interfaceLegacyDataAppAdapter
-
transformToDeprecatedDataObjectRelationship
protected DataObjectRelationship transformToDeprecatedDataObjectRelationship(Class<?> dataObjectClass, String attributeName, String attributePrefix, Class<?> relatedObjectClass, org.kuali.rice.krad.data.metadata.DataObjectAttributeRelationship relationship) -
populateRelationshipFromDictionaryReference
protected DataObjectRelationship populateRelationshipFromDictionaryReference(Class<?> dataObjectClass, RelationshipDefinition ddReference, String attributePrefix, boolean keysOnly) -
isPersistable
- Specified by:
isPersistablein interfaceLegacyDataAppAdapter
-
getRelationshipMetadata
protected DataObjectRelationship getRelationshipMetadata(Class<?> dataObjectClass, String attributeName, String attributePrefix) -
classHasSupportedFeatures
protected boolean classHasSupportedFeatures(Class<?> relationshipClass, boolean supportsLookup, boolean supportsInquiry) -
getForeignKeyFieldsPopulationState
public ForeignKeyFieldsPopulationState getForeignKeyFieldsPopulationState(Object dataObject, String referenceName) - Specified by:
getForeignKeyFieldsPopulationStatein interfaceLegacyDataAppAdapter
-
getForeignKeysForReference
- Specified by:
getForeignKeysForReferencein interfaceLegacyDataAppAdapter
-
setObjectPropertyDeep
public <T> void setObjectPropertyDeep(Object bo, String propertyName, Class<T> type, T propertyValue) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException - Specified by:
setObjectPropertyDeepin interfaceLegacyDataAppAdapter- Throws:
IllegalAccessExceptionInvocationTargetExceptionNoSuchMethodException
-
hasPrimaryKeyFieldValues
- Specified by:
hasPrimaryKeyFieldValuesin interfaceLegacyDataAppAdapter
-
materializeClassForProxiedObject
- Specified by:
materializeClassForProxiedObjectin interfaceLegacyDataAppAdapter
-
getNestedValue
- Specified by:
getNestedValuein interfaceLegacyDataAppAdapter
-
createNewObjectFromClass
- Specified by:
createNewObjectFromClassin interfaceLegacyDataAppAdapter
-
isNull
- Specified by:
isNullin interfaceLegacyDataAppAdapter
-
setObjectProperty
public <T> void setObjectProperty(Object bo, String propertyName, Class<T> propertyType, T propertyValue) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException - Specified by:
setObjectPropertyin interfaceLegacyDataAppAdapter- Throws:
IllegalAccessExceptionInvocationTargetExceptionNoSuchMethodException
-
findByDocumentHeaderId
- Specified by:
findByDocumentHeaderIdin interfaceLegacyDataAdapter
-
findByDocumentHeaderIds
public <T extends Document> List<T> findByDocumentHeaderIds(Class<T> documentClass, List<String> ids) - Specified by:
findByDocumentHeaderIdsin interfaceLegacyDataAdapter
-
setDataObjectService
public void setDataObjectService(org.kuali.rice.krad.data.DataObjectService dataObjectService) -
setLookupCriteriaGenerator
-
setKualiConfigurationService
public void setKualiConfigurationService(org.kuali.rice.core.api.config.property.ConfigurationService kualiConfigurationService) -
setKualiModuleService
-
setDataDictionaryService
-
getViewDictionaryService
-
setViewDictionaryService
-
getDataObjectService
public org.kuali.rice.krad.data.DataObjectService getDataObjectService() -
getLookupCriteriaGenerator
-
getKualiConfigurationService
public org.kuali.rice.core.api.config.property.ConfigurationService getKualiConfigurationService() -
getKualiModuleService
-
getDataDictionaryService
-
getInactivateableFromToService
-
setInactivateableFromToService
-
getDocumentAdHocService
-
setDocumentAdHocService
-