public class DataObjectMetaDataServiceImpl extends Object implements DataObjectMetaDataService
| Constructor and Description |
|---|
DataObjectMetaDataServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
areNotesSupported(Class<?> dataObjectClass)
Indicates whether notes are supported by the given data object class, currently this
can only be true for business objects
|
protected boolean |
classHasSupportedFeatures(Class relationshipClass,
boolean supportsLookup,
boolean supportsInquiry) |
boolean |
equalsByPrimaryKeys(Object do1,
Object do2)
Compares two dataObject instances for equality of type and key values using toString()
of each value for comparison purposes.
|
protected BusinessObjectEntry |
getBusinessObjectEntry(Class businessObjectClass) |
protected DataDictionaryService |
getDataDictionaryService() |
protected DataObjectEntry |
getDataObjectEntry(Class<?> dataObjectClass) |
String |
getDataObjectIdentifierString(Object dataObject)
Builds a string that uniquely identifiers the data object instance
|
DataObjectRelationship |
getDataObjectRelationship(Object dataObject,
Class<?> dataObjectClass,
String attributeName,
String attributePrefix,
boolean keysOnly,
boolean supportsLookup,
boolean supportsInquiry)
Attempts to find a relationship for the given attribute within the given
data object
|
protected DataObjectRelationship |
getDataObjectRelationship(RelationshipDefinition ddReference,
Object dataObject,
Class<?> dataObjectClass,
String attributeName,
String attributePrefix,
boolean keysOnly,
boolean supportsLookup,
boolean supportsInquiry) |
List<DataObjectRelationship> |
getDataObjectRelationships(Class<?> dataObjectClass)
Attempts to find relationships for the given data object class
|
RelationshipDefinition |
getDictionaryRelationship(Class<?> c,
String attributeName)
gets the relationship that the attribute represents on the class
|
protected KualiModuleService |
getKualiModuleService() |
protected PersistenceStructureService |
getPersistenceStructureService() |
Map<String,?> |
getPrimaryKeyFieldValues(Object dataObject)
Determines the primary keys for the class of the given object, then for each
key field retrieves the value from the object instance and populates the return
map with the primary key name as the map key and the object value as the map value
|
Map<String,?> |
getPrimaryKeyFieldValues(Object dataObject,
boolean sortFieldNames)
Determines the primary keys for the class of the given object, then for each
key field retrieves the value from the object instance and populates the return
map with the primary key name as the map key and the object value as the map value
|
protected DataObjectRelationship |
getRelationshipMetadata(Class<?> dataObjectClass,
String attributeName,
String attributePrefix) |
String |
getTitleAttribute(Class<?> dataObjectClass)
Returns the attribute to be associated with for object level markings.
|
protected ViewDictionaryService |
getViewDictionaryService() |
boolean |
hasLocalInquiry(Class<?> dataObjectClass)
Determines whether the given data object class has an associated inquiry in the local
running application
|
boolean |
hasLocalLookup(Class<?> dataObjectClass)
Determines whether the given data object class has an associated lookup in the local
running application
|
List<String> |
listPrimaryKeyFieldNames(Class<?> clazz)
Checks the DataDictionary and OJB Repository File to determine the primary
fields names for a given class.
|
protected DataObjectRelationship |
populateRelationshipFromDictionaryReference(Class<?> dataObjectClass,
RelationshipDefinition ddReference,
String attributePrefix,
boolean keysOnly) |
void |
setDataDictionaryService(DataDictionaryService dataDictionaryService) |
void |
setKualiModuleService(KualiModuleService kualiModuleService) |
void |
setPersistenceStructureService(PersistenceStructureService persistenceStructureService) |
void |
setViewDictionaryService(ViewDictionaryService viewDictionaryService) |
protected void |
validateBusinessObjectClass(Class businessObjectClass) |
public DataObjectMetaDataServiceImpl()
public List<String> listPrimaryKeyFieldNames(Class<?> clazz)
DataObjectMetaDataServicelistPrimaryKeyFieldNames in interface DataObjectMetaDataServiceclazz - - the Class to check for primary keysDataObjectMetaDataService.listPrimaryKeyFieldNames(java.lang.Class)public Map<String,?> getPrimaryKeyFieldValues(Object dataObject)
DataObjectMetaDataServicegetPrimaryKeyFieldValues in interface DataObjectMetaDataServicedataObject - - object whose primary key field name,value pairs you wantDataObjectMetaDataService.getPrimaryKeyFieldValues(java.lang.Object)public Map<String,?> getPrimaryKeyFieldValues(Object dataObject, boolean sortFieldNames)
DataObjectMetaDataServicegetPrimaryKeyFieldValues in interface DataObjectMetaDataServicedataObject - - object whose primary key field name,value pairs you wantsortFieldNames - - if true, the returned Map will iterate through its entries sorted by fieldNameDataObjectMetaDataService.getPrimaryKeyFieldValues(java.lang.Object,
boolean)public boolean equalsByPrimaryKeys(Object do1, Object do2)
DataObjectMetaDataServiceequalsByPrimaryKeys in interface DataObjectMetaDataServiceDataObjectMetaDataService.equalsByPrimaryKeys(java.lang.Object,
java.lang.Object)public DataObjectRelationship getDataObjectRelationship(Object dataObject, Class<?> dataObjectClass, String attributeName, String attributePrefix, boolean keysOnly, boolean supportsLookup, boolean supportsInquiry)
DataObjectMetaDataService
First the data dictionary is queried to find any relationship definitions
setup that include the attribute, if found the
BusinessObjectRetationship is build from that. If not and
the data object class is persistent, relationships are retrieved from the
persistence service. Nested attributes are handled in addition to
external business objects. If multiple relationships are found, the one
that contains the least amount of joining keys is returned
getDataObjectRelationship in interface DataObjectMetaDataServicedataObject - - data object instance that contains the attributedataObjectClass - - class for the data object that contains the attributeattributeName - - property name for the attributeattributePrefix - - property prefix for the attributekeysOnly - - indicates whether only primary key fields should be returned
in the relationshipsupportsLookup - - indicates whether the relationship should support lookupsupportsInquiry - - indicates whether the relationship should support inquiryDataObjectMetaDataService.getDataObjectRelationship(java.lang.Object,
java.lang.Class, java.lang.String, java.lang.String, boolean,
boolean, boolean)protected DataObjectRelationship getDataObjectRelationship(RelationshipDefinition ddReference, Object dataObject, Class<?> dataObjectClass, String attributeName, String attributePrefix, boolean keysOnly, boolean supportsLookup, boolean supportsInquiry)
protected boolean classHasSupportedFeatures(Class relationshipClass, boolean supportsLookup, boolean supportsInquiry)
public RelationshipDefinition getDictionaryRelationship(Class<?> c, String attributeName)
getDictionaryRelationship in interface DataObjectMetaDataServicec - - the class to which the attribute belongsattributeName - - property name for the attributeprotected DataObjectRelationship populateRelationshipFromDictionaryReference(Class<?> dataObjectClass, RelationshipDefinition ddReference, String attributePrefix, boolean keysOnly)
protected DataObjectRelationship getRelationshipMetadata(Class<?> dataObjectClass, String attributeName, String attributePrefix)
public String getTitleAttribute(Class<?> dataObjectClass)
DataObjectMetaDataServicegetTitleAttribute in interface DataObjectMetaDataServicedataObjectClass - - data object class to obtain title attribute ofDataObjectMetaDataService.getTitleAttribute(java.lang.Class)public boolean areNotesSupported(Class<?> dataObjectClass)
DataObjectMetaDataServiceareNotesSupported in interface DataObjectMetaDataServicedataObjectClass - - class for data object to checkDataObjectMetaDataService.areNotesSupported(java.lang.Class)public String getDataObjectIdentifierString(Object dataObject)
DataObjectMetaDataService
Based on the metadata available for the class of the data object, the values for fields that uniquely
identify an instance are concatenated together into one string. For general data objects these fields
will be the primary key fields defined in the data dictionary. For the case of objects with type
PersistableBusinessObject, the object id field will be used.
getDataObjectIdentifierString in interface DataObjectMetaDataServicedataObject - - data object instance to build identifier string forDataObjectMetaDataService.getDataObjectIdentifierString(java.lang.Object)protected DataObjectEntry getDataObjectEntry(Class<?> dataObjectClass)
dataObjectClass - IllegalArgumentException - if the given Class is nullpublic List<DataObjectRelationship> getDataObjectRelationships(Class<?> dataObjectClass)
DataObjectMetaDataService
First the data dictionary is queried to find any relationship definitions
BusinessObjectRetationship is build from that. If not and
the data object class is persistent, relationships are retrieved from the
persistence service. Nested attributes are handled in addition to
external business objects. If multiple relationships are found, the one
that contains the least amount of joining keys is returned
getDataObjectRelationships in interface DataObjectMetaDataServicedataObjectClass - - class for the data object that contains the attributepublic boolean hasLocalLookup(Class<?> dataObjectClass)
DataObjectMetaDataServicehasLocalLookup in interface DataObjectMetaDataServicedataObjectClass - data object class to find lookup forDataObjectMetaDataService.hasLocalLookup(java.lang.Class<?>)public boolean hasLocalInquiry(Class<?> dataObjectClass)
DataObjectMetaDataServicehasLocalInquiry in interface DataObjectMetaDataServicedataObjectClass - data object class to find inquiry forDataObjectMetaDataService.hasLocalInquiry(java.lang.Class<?>)protected BusinessObjectEntry getBusinessObjectEntry(Class businessObjectClass)
businessObjectClass - - class of business object to return entry forprotected void validateBusinessObjectClass(Class businessObjectClass)
businessObjectClass - IllegalArgumentException - if the given Class is null or is not a BusinessObject classprotected DataDictionaryService getDataDictionaryService()
public void setDataDictionaryService(DataDictionaryService dataDictionaryService)
protected KualiModuleService getKualiModuleService()
public void setKualiModuleService(KualiModuleService kualiModuleService)
protected PersistenceStructureService getPersistenceStructureService()
public void setPersistenceStructureService(PersistenceStructureService persistenceStructureService)
protected ViewDictionaryService getViewDictionaryService()
public void setViewDictionaryService(ViewDictionaryService viewDictionaryService)
Copyright © 2005-2015 The Kuali Foundation. All Rights Reserved.