|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.service.impl.DataObjectMetaDataServiceImpl
public class DataObjectMetaDataServiceImpl
Constructor Summary | |
---|---|
DataObjectMetaDataServiceImpl()
|
Method Summary | |
---|---|
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 method to allow subclasses to access the dataDictionaryService. |
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)
|
RelationshipDefinition |
getDictionaryRelationship(Class<?> c,
String attributeName)
Fetches the RelationshipDefinition for the attribute with the given name within the given class |
protected KualiModuleService |
getKualiModuleService()
Protected method to allow subclasses to access the kualiModuleService. |
protected PersistenceStructureService |
getPersistenceStructureService()
Protected method to allow subclasses to access the persistenceStructureService. |
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()
|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataObjectMetaDataServiceImpl()
Method Detail |
---|
public List<String> listPrimaryKeyFieldNames(Class<?> clazz)
DataObjectMetaDataService
listPrimaryKeyFieldNames
in interface DataObjectMetaDataService
clazz
- - the Class to check for primary keys
DataObjectMetaDataService.listPrimaryKeyFieldNames(java.lang.Class)
public Map<String,?> getPrimaryKeyFieldValues(Object dataObject)
DataObjectMetaDataService
getPrimaryKeyFieldValues
in interface DataObjectMetaDataService
dataObject
- - object whose primary key field name,value pairs you want
DataObjectMetaDataService.getPrimaryKeyFieldValues(java.lang.Object)
public Map<String,?> getPrimaryKeyFieldValues(Object dataObject, boolean sortFieldNames)
DataObjectMetaDataService
getPrimaryKeyFieldValues
in interface DataObjectMetaDataService
dataObject
- - object whose primary key field name,value pairs you wantsortFieldNames
- - if true, the returned Map will iterate through its entries sorted by fieldName
DataObjectMetaDataService.getPrimaryKeyFieldValues(java.lang.Object,
boolean)
public boolean equalsByPrimaryKeys(Object do1, Object do2)
DataObjectMetaDataService
equalsByPrimaryKeys
in interface DataObjectMetaDataService
DataObjectMetaDataService.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 DataObjectMetaDataService
dataObject
- - 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 lookup
DataObjectMetaDataService.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)
DataObjectMetaDataService
getDictionaryRelationship
in interface DataObjectMetaDataService
c
- - data object class that contains the attributeattributeName
- - property name for the attribute
protected DataObjectRelationship populateRelationshipFromDictionaryReference(Class<?> dataObjectClass, RelationshipDefinition ddReference, String attributePrefix, boolean keysOnly)
protected DataObjectRelationship getRelationshipMetadata(Class<?> dataObjectClass, String attributeName, String attributePrefix)
public String getTitleAttribute(Class<?> dataObjectClass)
DataObjectMetaDataService
getTitleAttribute
in interface DataObjectMetaDataService
dataObjectClass
- - data object class to obtain title attribute of
DataObjectMetaDataService.getTitleAttribute(java.lang.Class)
public boolean areNotesSupported(Class dataObjectClass)
DataObjectMetaDataService
areNotesSupported
in interface DataObjectMetaDataService
dataObjectClass
- - class for data object to check
DataObjectMetaDataService.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 DataObjectMetaDataService
dataObject
- - data object instance to build identifier string for
DataObjectMetaDataService.getDataObjectIdentifierString(java.lang.Object)
protected DataObjectEntry getDataObjectEntry(Class<?> dataObjectClass)
dataObjectClass
-
IllegalArgumentException
- if the given Class is nullprotected BusinessObjectEntry getBusinessObjectEntry(Class businessObjectClass)
businessObjectClass
- - class of business object to return entry for
protected 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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |