net.sf.oness.common.model.dao
Class AuditingDaoHelper

java.lang.Object
  extended bynet.sf.oness.common.model.dao.AuditingDaoHelper

public class AuditingDaoHelper
extends java.lang.Object

Class with helper methods to implement an auditing dao

Version:
$Revision: 1.14 $
Author:
Carlos Sanchez

Constructor Summary
AuditingDaoHelper()
           
 
Method Summary
static AuditableBusinessObject create(AuditableDao dao, AuditableBusinessObject value)
          Set creation date, code and createdBy before saving
static void delete(AuditableDao dao, java.io.Serializable id)
          Set deletion date and deletedBy
static AuditableBusinessObject update(AuditableDao dao, AuditableBusinessObject value)
          Save a new object with createdBy and curent date as creation date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuditingDaoHelper

public AuditingDaoHelper()
Method Detail

create

public static AuditableBusinessObject create(AuditableDao dao,
                                             AuditableBusinessObject value)
Set creation date, code and createdBy before saving

See Also:
net.sf.oness.common.model.dao.AuditableDao#create(net.sf.oness.common.model.bo.Auditable)

update

public static AuditableBusinessObject update(AuditableDao dao,
                                             AuditableBusinessObject value)
Save a new object with createdBy and curent date as creation date. Update deletion date and deletedBy in the old value.

Returns:
the value returned by AuditableDao#create(Auditable)
Throws:
org.springframework.dao.OptimisticLockingFailureException - if the value has been already updated or deleted
See Also:
net.sf.oness.common.model.dao.AuditableDao#update(net.sf.oness.common.model.bo.Auditable)

delete

public static void delete(AuditableDao dao,
                          java.io.Serializable id)
Set deletion date and deletedBy

Throws:
org.springframework.dao.OptimisticLockingFailureException - if the value has been already updated or deleted
See Also:
net.sf.oness.common.model.dao.AuditableDao#delete(java.io.Serializable)


Copyright © 2003-2005 ONess Project. All Rights Reserved.