org.kuali.rice.krad.bo
Class PersistableBusinessObjectBase

java.lang.Object
  extended by org.kuali.rice.krad.bo.BusinessObjectBase
      extended by org.kuali.rice.krad.bo.PersistableBusinessObjectBase
All Implemented Interfaces:
Serializable, org.apache.ojb.broker.PersistenceBrokerAware, GloballyUnique, Versioned, ModelObjectBasic, BusinessObject, PersistableBusinessObject
Direct Known Subclasses:
Address, AdHocRouteRecipient, AgendaEditor, AgendaItemBo, ApplicationDocumentStatus, Attachment, AttachmentSample, AttributeReferenceDummy, Author, Book, BookOrder, BookType, BSAddressType, BusinessObjectAttributeEntry, DocumentBase, DocumentHeader, DocumentRouteHeaderValue, DocumentStatusTransition, DocumentType, DocumentTypePolicy, EDocLiteAssociation, EDocLiteDefinition, FiscalOfficer, GenericPermissionBo, GlobalBusinessObjectDetailBase, InactivatableFromToImpl, KimAttributeDataBo, KimDocumentBoBase, KualiCodeBase, MaintenanceLock, MultiAttachmentSample, MultipleValueLookupMetadata, Note, NoteType, NotificationBo, NotificationChannelBo, NotificationChannelReviewerBo, NotificationContentTypeBo, NotificationMessageDelivery, NotificationPriorityBo, NotificationProducerBo, NotificationRecipientBo, NotificationRecipientListBo, NotificationSenderBo, ParameterBo, PermissionBo, PersistableAttachmentBase, PersistableBusinessObjectExtensionBase, PessimisticLock, RoleDocumentBoBase, RouteNodeConfigParam, RuleAttribute, RuleBaseValues, RuleDelegationBo, RuleExpressionDef, RuleResponsibilityBo, RuleTemplateAttributeBo, RuleTemplateBo, SessionDocument, State, TemplateBo, TravelAccount, TravelAccountType, UserChannelSubscriptionBo

@MappedSuperclass
public abstract class PersistableBusinessObjectBase
extends BusinessObjectBase
implements PersistableBusinessObject, org.apache.ojb.broker.PersistenceBrokerAware, Versioned, GloballyUnique

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Field Summary
protected  PersistableBusinessObjectExtension extension
           
protected  Long versionNumber
           
 
Constructor Summary
PersistableBusinessObjectBase()
           
 
Method Summary
 void afterDelete(org.apache.ojb.broker.PersistenceBroker persistenceBroker)
          Implementation of the OJB afterDelete hook which delegates to postRemove().
 void afterInsert(org.apache.ojb.broker.PersistenceBroker persistenceBroker)
          Implementation of the OJB afterInsert hook which delegates to postPersist().
 void afterLookup(org.apache.ojb.broker.PersistenceBroker persistenceBroker)
          Implementation of the OJB afterLookup hook which delegates to postLoad().
 void afterUpdate(org.apache.ojb.broker.PersistenceBroker persistenceBroker)
          Implementation of the OJB afterUpdate hook which delegates to postUpdate().
 void beforeDelete(org.apache.ojb.broker.PersistenceBroker persistenceBroker)
          Implementation of the OJB beforeDelete hook which delegates to preRemove().
 void beforeInsert(org.apache.ojb.broker.PersistenceBroker persistenceBroker)
          Implementation of the OJB beforeInsert hook which delegates to prePersist().
 void beforeUpdate(org.apache.ojb.broker.PersistenceBroker persistenceBroker)
          Implementation of the OJB beforeUpdate hook which delegates to preUpdate().
 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()
           
 String getObjectId()
          getter for the guid based object id that is assignable to all objects, in order to support custom attributes a mapping must also be added to the OJB file and a column must be added to the database for each business object that extension attributes are supposed to work on.
protected static PersistenceService getPersistenceService()
           
protected static PersistenceStructureService getPersistenceStructureService()
           
 Long getVersionNumber()
          Returns the version number for this object.
 boolean isNewCollectionRecord()
          Gets the newCollectionRecord attribute.
 void linkEditableUserFields()
          Hook to link in any editable user fields.
protected  void postLoad()
          Default implementation of the JPA PostLoad hook.
protected  void postPersist()
          Default implementation of the JPA PostPersist hook.
protected  void postRemove()
          Default implementation of the JPA PostRemove hook.
protected  void postUpdate()
          Default implementation of the JPA PostUpdate hook.
protected  void prePersist()
          Default implementation of the JPA PrePersist hook which generates the unique objectId for this persistable business object if it does not already have one.
protected  void preRemove()
          Default implementation of the JPA PreRemove hook.
protected  void preUpdate()
          Default implementation of the JPA PreUpdate hook which generates the unique objectId for this persistable business object if it does not already have one.
 void refresh()
          getService Refreshes the reference objects from the primitive values.
 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 newCollectionRecord attribute value.
 void setObjectId(String objectId)
          setter for the guid based object id that is assignable to all objects, in order to support custom attributes a mapping must also be added to the OJB file and column must be added to the database for each business object that extension attributes are supposed to work on.
 void setVersionNumber(Long versionNumber)
          Sets the business object's version number.
 
Methods inherited from class org.kuali.rice.krad.bo.BusinessObjectBase
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.core.api.mo.ModelObjectBasic
toString
 

Field Detail

versionNumber

protected Long versionNumber

extension

protected PersistableBusinessObjectExtension extension
Constructor Detail

PersistableBusinessObjectBase

public PersistableBusinessObjectBase()
Method Detail

getVersionNumber

public Long getVersionNumber()
Description copied from interface: Versioned
Returns the version number for this object. In general, this value should only be null if the object has not yet been stored to a persistent data store. This version number is generally used for the purposes of optimistic locking.

Specified by:
getVersionNumber in interface Versioned
Returns:
the version number, or null if one has not been assigned yet
See Also:
Versioned.getVersionNumber()

setVersionNumber

public void setVersionNumber(Long versionNumber)
Description copied from interface: PersistableBusinessObject
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.

Specified by:
setVersionNumber in interface PersistableBusinessObject
Parameters:
versionNumber - the version number to set on this business object
See Also:
Versioned.getVersionNumber()

getObjectId

public String getObjectId()
getter for the guid based object id that is assignable to all objects, in order to support custom attributes a mapping must also be added to the OJB file and a column must be added to the database for each business object that extension attributes are supposed to work on.

Specified by:
getObjectId in interface GloballyUnique
Returns:

setObjectId

public void setObjectId(String objectId)
setter for the guid based object id that is assignable to all objects, in order to support custom attributes a mapping must also be added to the OJB file and column must be added to the database for each business object that extension attributes are supposed to work on.

Specified by:
setObjectId in interface PersistableBusinessObject
Parameters:
objectId -

isNewCollectionRecord

public boolean isNewCollectionRecord()
Gets the newCollectionRecord attribute.

Specified by:
isNewCollectionRecord in interface PersistableBusinessObject
Returns:
Returns the newCollectionRecord.

setNewCollectionRecord

public void setNewCollectionRecord(boolean isNewCollectionRecord)
Sets the newCollectionRecord attribute value.

Specified by:
setNewCollectionRecord in interface PersistableBusinessObject
Parameters:
isNewCollectionRecord - The newCollectionRecord to set.

afterDelete

public final void afterDelete(org.apache.ojb.broker.PersistenceBroker persistenceBroker)
                       throws org.apache.ojb.broker.PersistenceBrokerException
Implementation of the OJB afterDelete hook which delegates to postRemove(). This method is final because it is recommended that sub-classes override and implement postRemove if they need to take advantage of this persistence hook.

Specified by:
afterDelete in interface org.apache.ojb.broker.PersistenceBrokerAware
Throws:
org.apache.ojb.broker.PersistenceBrokerException
See Also:
PersistenceBrokerAware.afterDelete(org.apache.ojb.broker.PersistenceBroker)

postRemove

protected void postRemove()
Default implementation of the JPA PostRemove hook. This implementation currently does nothing, however sub-classes can override and implement this method if needed.

This method is currently invoked by the corresponding OJB afterDelete(PersistenceBroker) hook.


afterInsert

public final void afterInsert(org.apache.ojb.broker.PersistenceBroker persistenceBroker)
                       throws org.apache.ojb.broker.PersistenceBrokerException
Implementation of the OJB afterInsert hook which delegates to postPersist(). This method is final because it is recommended that sub-classes override and implement postPersist if they need to take advantage of this persistence hook.

Specified by:
afterInsert in interface org.apache.ojb.broker.PersistenceBrokerAware
Throws:
org.apache.ojb.broker.PersistenceBrokerException
See Also:
PersistenceBrokerAware.afterInsert(org.apache.ojb.broker.PersistenceBroker)

postPersist

protected void postPersist()
Default implementation of the JPA PostPersist hook. This implementation currently does nothing, however sub-classes can override and implement this method if needed.

This method is currently invoked by the corresponding OJB afterInsert(PersistenceBroker) hook.


afterLookup

public final void afterLookup(org.apache.ojb.broker.PersistenceBroker persistenceBroker)
                       throws org.apache.ojb.broker.PersistenceBrokerException
Implementation of the OJB afterLookup hook which delegates to postLoad(). This method is final because it is recommended that sub-classes override and implement postLoad if they need to take advantage of this persistence hook.

Specified by:
afterLookup in interface org.apache.ojb.broker.PersistenceBrokerAware
Throws:
org.apache.ojb.broker.PersistenceBrokerException
See Also:
PersistenceBrokerAware.afterLookup(org.apache.ojb.broker.PersistenceBroker)

postLoad

protected void postLoad()
Default implementation of the JPA PostLoad hook. This implementation currently does nothing, however sub-classes can override and implement this method if needed.

This method is currently invoked by the corresponding OJB afterLookup(PersistenceBroker) hook.


afterUpdate

public final void afterUpdate(org.apache.ojb.broker.PersistenceBroker persistenceBroker)
                       throws org.apache.ojb.broker.PersistenceBrokerException
Implementation of the OJB afterUpdate hook which delegates to postUpdate(). This method is final because it is recommended that sub-classes override and implement postUpdate if they need to take advantage of this persistence hook.

Specified by:
afterUpdate in interface org.apache.ojb.broker.PersistenceBrokerAware
Throws:
org.apache.ojb.broker.PersistenceBrokerException
See Also:
PersistenceBrokerAware.afterUpdate(org.apache.ojb.broker.PersistenceBroker)

postUpdate

protected void postUpdate()
Default implementation of the JPA PostUpdate hook. This implementation currently does nothing, however sub-classes can override and implement this method if needed.

This method is currently invoked by the corresponding OJB afterUpdate(PersistenceBroker) hook.


beforeDelete

public final void beforeDelete(org.apache.ojb.broker.PersistenceBroker persistenceBroker)
                        throws org.apache.ojb.broker.PersistenceBrokerException
Implementation of the OJB beforeDelete hook which delegates to preRemove(). This method is final because it is recommended that sub-classes override and implement preRemove if they need to take advantage of this persistence hook.

Specified by:
beforeDelete in interface org.apache.ojb.broker.PersistenceBrokerAware
Throws:
org.apache.ojb.broker.PersistenceBrokerException
See Also:
PersistenceBrokerAware.beforeDelete(org.apache.ojb.broker.PersistenceBroker)

preRemove

protected void preRemove()
Default implementation of the JPA PreRemove hook. This implementation currently does nothing, however sub-classes can implement this method if needed.

This method is currently invoked by the corresponding OJB beforeDelete(PersistenceBroker) hook.


beforeInsert

public final void beforeInsert(org.apache.ojb.broker.PersistenceBroker persistenceBroker)
                        throws org.apache.ojb.broker.PersistenceBrokerException
Implementation of the OJB beforeInsert hook which delegates to prePersist(). This method is final because it is recommended that sub-classes override and implement prePersist if they need to take advantage of this persistence hook.

Specified by:
beforeInsert in interface org.apache.ojb.broker.PersistenceBrokerAware
Throws:
org.apache.ojb.broker.PersistenceBrokerException
See Also:
PersistenceBrokerAware.beforeInsert(org.apache.ojb.broker.PersistenceBroker)

prePersist

protected void prePersist()
Default implementation of the JPA PrePersist hook which generates the unique objectId for this persistable business object if it does not already have one. Any sub-class which overrides this method should take care to invoke super.prePersist to ensure that the objectId for this persistable business object is generated properly.

This method is currently invoked by the corresponding OJB beforeInsert(PersistenceBroker) hook.


beforeUpdate

public final void beforeUpdate(org.apache.ojb.broker.PersistenceBroker persistenceBroker)
                        throws org.apache.ojb.broker.PersistenceBrokerException
Implementation of the OJB beforeUpdate hook which delegates to preUpdate(). This method is final because it is recommended that sub-classes override and implement preUpdate if they need to take advantage of this persistence hook.

Specified by:
beforeUpdate in interface org.apache.ojb.broker.PersistenceBrokerAware
Throws:
org.apache.ojb.broker.PersistenceBrokerException
See Also:
PersistenceBrokerAware.beforeUpdate(org.apache.ojb.broker.PersistenceBroker)

preUpdate

protected void preUpdate()
Default implementation of the JPA PreUpdate hook which generates the unique objectId for this persistable business object if it does not already have one. Any sub-class which overrides this method should take care to invoke super.preUpdate to ensure that the objectId for this persistable business object is generated properly.

This method is currently invoked by the corresponding OJB beforeUpdate(PersistenceBroker) hook.


refresh

public void refresh()
getService Refreshes the reference objects from the primitive values.

Specified by:
refresh in interface BusinessObject
See Also:
BusinessObject.refresh()

refreshNonUpdateableReferences

public void refreshNonUpdateableReferences()
Specified by:
refreshNonUpdateableReferences in interface PersistableBusinessObject
See Also:
BusinessObject.refresh()

refreshReferenceObject

public void refreshReferenceObject(String referenceObjectName)
Description copied from interface: PersistableBusinessObject
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.

Specified by:
refreshReferenceObject in interface PersistableBusinessObject

buildListOfDeletionAwareLists

public List<Collection<PersistableBusinessObject>> buildListOfDeletionAwareLists()
Description copied from interface: PersistableBusinessObject
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.

Specified by:
buildListOfDeletionAwareLists in interface PersistableBusinessObject
Returns:
List of collections which need to be monitored for changes by OJB
See Also:
PersistableBusinessObject.buildListOfDeletionAwareLists()

linkEditableUserFields

public void linkEditableUserFields()
Description copied from interface: PersistableBusinessObject
Hook to link in any editable user fields.

Specified by:
linkEditableUserFields in interface PersistableBusinessObject

getExtension

public PersistableBusinessObjectExtension getExtension()
Specified by:
getExtension in interface PersistableBusinessObject

setExtension

public void setExtension(PersistableBusinessObjectExtension extension)
Specified by:
setExtension in interface PersistableBusinessObject

getPersistenceService

protected static PersistenceService getPersistenceService()
Returns:
the persistenceService

getPersistenceStructureService

protected static PersistenceStructureService getPersistenceStructureService()


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