org.kuali.rice.krad.bo
Interface PersistableBusinessObject

All Superinterfaces:
BusinessObject, GloballyUnique, ModelObjectBasic, Serializable, Versioned
All Known Subinterfaces:
Document, MaintenanceDocument, MaintenanceDocument, PersistableBusinessObjectExtension, TransactionalDocument
All Known Implementing Classes:
Account, ActualExpense, Address, AdHocRoutePerson, AdHocRouteRecipient, AdHocRouteWorkgroup, AgendaEditor, AgendaItemBo, ApplicationDocumentStatus, ApplicationDocumentStatusCategory, Attachment, AttachmentSample, AttributeReferenceDummy, AttributeReferenceElements, Author, BaseJavaAttributeBo, Book, BookOrder, BookOrderDocument, BookType, BranchState, BSAddressType, BusinessObjectAttributeEntry, DocumentAttachment, DocumentBase, DocumentHeader, DocumentRouteHeaderValue, DocumentRouteHeaderValueActionListExtension, DocumentStatusTransition, DocumentType, DocumentTypePolicy, EDocLiteAssociation, EDocLiteDefinition, FiscalOfficer, GenericPermissionBo, GlobalBusinessObjectDetailBase, GroupDocumentMember, GroupDocumentQualifier, GroupRuleResponsibility, IdentityManagementGroupDocument, IdentityManagementKimDocument, IdentityManagementPersonDocument, IdentityManagementRoleDocument, IdentityManagementTypeAttributeTransactionalDocument, ImportedExpense, InactivatableFromToImpl, KimAttributeDataBo, KimDocumentAttributeDataBusinessObjectBase, KimDocumentBoActivatableBase, KimDocumentBoActivatableEditableBase, KimDocumentBoActivatableToFromBase, KimDocumentBoActivatableToFromEditableBase, KimDocumentBoActiveToFromBase, KimDocumentBoBase, KimDocumentBoEditableBase, KimDocumentRoleMember, KimDocumentRolePermission, KimDocumentRoleQualifier, KimDocumentRoleResponsibility, KimDocumentRoleResponsibilityAction, KualiCodeBase, LookupResults, MaintenanceDocumentBase, MaintenanceDocumentBase, MaintenanceLock, Message, MultiAttachmentSample, MultiDocumentAttachment, MultipleValueLookupMetadata, NaturalLanguageTemplateAttributeBo, NaturalLanguageTemplateBo, NaturalLanguageUsageBo, NodeState, Note, NoteType, NotificationBo, NotificationChannelBo, NotificationChannelReviewerBo, NotificationContentTypeBo, NotificationMessageDelivery, NotificationPriorityBo, NotificationProducerBo, NotificationRecipientBo, NotificationRecipientListBo, NotificationSenderBo, ParameterBo, PerDiemExpense, PermissionAttributeBo, PermissionBo, PermissionTemplateBo, PersistableAttachmentBase, PersistableBusinessObjectBase, PersistableBusinessObjectExtensionBase, PersonDocumentAddress, PersonDocumentAffiliation, PersonDocumentBoDefaultBase, PersonDocumentCitizenship, PersonDocumentEmail, PersonDocumentEmploymentInfo, PersonDocumentExternalId, PersonDocumentGroup, PersonDocumentName, PersonDocumentPhone, PersonDocumentPrivacy, PersonDocumentRole, PersonRuleResponsibility, PessimisticLock, PrimaryDestination, ReferenceObjectBindingBo, RoleDocumentBoBase, RoleDocumentBoDefaultBase, RoleDocumentDelegation, RoleDocumentDelegationMember, RoleDocumentDelegationMemberQualifier, RoleRuleResponsibility, RouteNodeConfigParam, RuleAttribute, RuleBaseValues, RuleDelegationBo, RuleDocument, RuleExpressionDef, RuleResponsibilityBo, RuleTemplateAttributeBo, RuleTemplateBo, SelectedObjectIds, SessionDocument, State, TemplateBo, TransactionalDocumentBase, TransportationMode, TransportationModeDetail, TravelAccount, TravelAccountExtension, TravelAccountType, TravelAccountUseRate, TravelAdvance, TravelAuthorizationDocument, TravelDocument2, TravelerDetail, TravelerDetailEmergencyContact, TravelerType, TripType, TypeTypeRelationBo, UberPermissionBo, UserChannelSubscriptionBo, WebRuleBaseValues, WebRuleResponsibility

public interface PersistableBusinessObject
extends BusinessObject, Versioned, GloballyUnique

Declares a common interface for all BusinessObject classes which can have their state persisted. A business object which is persistable defines some additional methods which allow for various operations to be executed that relate to the persistent nature of the business object. A persistable business object also has some additional data attributes which include the version number, the object id, and the extension.

The version number indicates the version of the business object when it was retrieved from persistent storage. This allows for services to check this version number during persistence operations to prevent silent overwrites of business object state. These kinds of scenarios might arise as a result of concurrent modification to the business object in the persistent store (i.e. two web application users updating the same record in a database). The kind of check which would be performed using the version number is commonly referred to as "optimistic locking".

The object id represents a globally unique identifier for the business object. In practice, this can be used by other portions of the system to link to persistable business objects which might be stored in different locations or even different persistent data stores. In general, it is not the responsibility of the client who implements a persistable business object to handle generating this value. The framework will handle this automatically at the point in time when the business object is persisted. If the client does need to do this themselves, however, care should be taken that an appropriate globally unique value generator algorithm is used (such as the one provided by UUID).

The extension object is primarily provided for the purposes of allowing implementer customization of the business object without requiring the original business object to be modified. The additional PersistableBusinessObjectExtension which is linked with the parent business object can contain additional data attributes and methods. The framework will automatically request that this extension object be persisted when the parent business object is persisted. This is generally the most useful in cases where an application is defining business objects that will be used in redistributable software packages (such as the actual Kuali Foundation projects themselves). If using the framework for the purposes of implementing an internal application, the use of a business object extensions is likely unnecessary.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Method Summary
 List<Collection<PersistableBusinessObject>> buildListOfDeletionAwareLists()
          If this method is not implemented appropriately for PersistableBusinessObject with collections, then PersistableBusinessObject with collections will not persist deletions correctly.
 PersistableBusinessObjectExtension getExtension()
           
 boolean isNewCollectionRecord()
          Returns the boolean indicating whether this record is a new record of a maintenance document collection.
 void linkEditableUserFields()
          Hook to link in any editable user fields.
 void refreshNonUpdateableReferences()
           
 void refreshReferenceObject(String referenceObjectName)
          This method is used to refresh a reference object that hangs off of a document.
 void setExtension(PersistableBusinessObjectExtension extension)
           
 void setNewCollectionRecord(boolean isNewCollectionRecord)
          Sets the boolean indicating this record is a new record of a maintenance document collection.
 void setObjectId(String objectId)
          Sets the unique identifier for the object
 void setVersionNumber(Long versionNumber)
          Sets the business object's version number.
 
Methods inherited from interface org.kuali.rice.krad.bo.BusinessObject
refresh
 
Methods inherited from interface org.kuali.rice.core.api.mo.ModelObjectBasic
toString
 
Methods inherited from interface org.kuali.rice.core.api.mo.common.Versioned
getVersionNumber
 
Methods inherited from interface org.kuali.rice.core.api.mo.common.GloballyUnique
getObjectId
 

Method Detail

setVersionNumber

void setVersionNumber(Long versionNumber)
Sets the business object's version number. It is rarely advisable for client code to manually set this value as the framework should generally handle the management of version numbers internally.

Parameters:
versionNumber - the version number to set on this business object

setObjectId

void setObjectId(String objectId)
Sets the unique identifier for the object

Parameters:
objectId -

getExtension

PersistableBusinessObjectExtension getExtension()

setExtension

void setExtension(PersistableBusinessObjectExtension extension)

refreshNonUpdateableReferences

void refreshNonUpdateableReferences()
See Also:
BusinessObject.refresh()

refreshReferenceObject

void refreshReferenceObject(String referenceObjectName)
This method is used to refresh a reference object that hangs off of a document. For example, if the attribute's keys were updated for a reference object, but the reference object wasn't, this method would go out and retrieve the reference object.

Parameters:
referenceObjectName -

buildListOfDeletionAwareLists

List<Collection<PersistableBusinessObject>> buildListOfDeletionAwareLists()
If this method is not implemented appropriately for PersistableBusinessObject with collections, then PersistableBusinessObject with collections will not persist deletions correctly. Elements that have been deleted will reappear in the DB after retrieval.

Returns:
List of collections which need to be monitored for changes by OJB

isNewCollectionRecord

boolean isNewCollectionRecord()
Returns the boolean indicating whether this record is a new record of a maintenance document collection. Used to determine whether the record can be deleted on the document.


setNewCollectionRecord

void setNewCollectionRecord(boolean isNewCollectionRecord)
Sets the boolean indicating this record is a new record of a maintenance document collection. Used to determine whether the record can be deleted on the document.


linkEditableUserFields

void linkEditableUserFields()
Hook to link in any editable user fields.



Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.