org.kuali.rice.kns.service
Interface PersistenceService
- All Known Implementing Classes:
- PersistenceServiceImpl, PersistenceServiceJpaImpl, PersistenceServiceOjbImpl
public interface PersistenceService
loadRepositoryDescriptor
void loadRepositoryDescriptor(String ojbRepositoryFilePath)
clearCache
void clearCache()
resolveProxy
Object resolveProxy(Object o)
getPrimaryKeyFieldValues
Map getPrimaryKeyFieldValues(Object persistableObject)
- Parameters:
persistableObject
- object whose primary key field name,value pairs you want
- Returns:
- a Map containing the names and values of fields specified the given class which are designated as key fields in the
OJB repository file
- Throws:
IllegalArgumentException
- if the given Object is null
ClassNotPersistableException
- if the given object is of a type not described in the OJB repository
getPrimaryKeyFieldValues
Map getPrimaryKeyFieldValues(Object persistableObject,
boolean sortFieldNames)
- Parameters:
persistableObject
- object whose primary key field name,value pairs you wantsortFieldNames
- if true, the returned Map will iterate through its entries sorted by fieldName
- Returns:
- a Map containing the names and values of fields specified the given class which are designated as key fields in the
OJB repository file
- Throws:
IllegalArgumentException
- if the given Object is null
ClassNotPersistableException
- if the given object is of a type not described in the OJB repository
retrieveNonKeyFields
void retrieveNonKeyFields(Object persistableObject)
- Parameters:
persistableObject
- object whose objects need to be filled in based on primary keys
- Throws:
IllegalArgumentException
- if the given Object is null
ClassNotPersistableException
- if the given object is of a type not described in the OJB repository
retrieveReferenceObject
void retrieveReferenceObject(Object persistableObject,
String referenceObjectName)
- Parameters:
persistableObject
- object whose specified reference object needs to be filled in based on primary keysreferenceObjectName
- the name of the reference object that will be filled in based on primary key values
- Throws:
IllegalArgumentException
- if the given Object is null
ClassNotPersistableException
- if the given object is of a type not described in the OJB repository
retrieveReferenceObjects
void retrieveReferenceObjects(Object persistableObject,
List referenceObjectNames)
- Parameters:
persistableObject
- object whose specified reference objects need to be filled in based on primary keysreferenceObjectNames
- the names of the reference objects that will be filled in based on primary key values
- Throws:
IllegalArgumentException
- if either of the given lists is null or empty, or if any of the referenceObjectNames is
blank
ClassNotPersistableException
- if the given object is of a type not described in the OJB repository
retrieveReferenceObjects
void retrieveReferenceObjects(List persistableObjects,
List referenceObjectNames)
- Parameters:
persistableObjects
- objects whose specified reference objects need to be filled in based on primary keysreferenceObjectNames
- the names of the reference objects that will be filled in based on primary key values
- Throws:
IllegalArgumentException
- if either of the given lists is null or empty, or if any of the referenceObjectNames is
blank
ClassNotPersistableException
- if the given object is of a type not described in the OJB repository
linkObjects
void linkObjects(Object persistableObject)
- Parameters:
persistableObject
- object whose objects need to have keys filled
- Throws:
IllegalArgumentException
- if the given Object is null
ClassNotPersistableException
- if the given object is of a type not described in the OJB repository
getFlattenedPrimaryKeyFieldValues
String getFlattenedPrimaryKeyFieldValues(Object persistableObject)
- Parameters:
persistableObject
- object whose primary key field name,value pairs you wantbounded
- - whether to restrict the number of rows returned
- Returns:
- a String representation of the primary key fields and values for the given persistableObject
- Throws:
IllegalArgumentException
- if the given Object is null
ClassNotPersistableException
- if the given object is of a type not described in the OJB repository
allForeignKeyValuesPopulatedForReference
boolean allForeignKeyValuesPopulatedForReference(PersistableBusinessObject bo,
String referenceName)
- This method examines whether all the foreign key fields for the specified reference contain values.
- Parameters:
bo
- referenceName
-
- Returns:
- true if they all are accessible and have values, false otherwise
refreshAllNonUpdatingReferences
void refreshAllNonUpdatingReferences(PersistableBusinessObject bo)
- This method refreshes all reference objects to this main object that are 'non-updateable'. In general, this means that if a
reference object is configured to not be updated when the parent document is saved, then they are non-updated.
This will not refresh updateable objects, which can cause problems when you're creating new objects.
See PersistenceServiceImpl.isUpdateableReference() for the full logic.
- Parameters:
bo
- - the businessObject to be refreshed
Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.