org.acegisecurity.domain.impl
Class AbstractPersistableEntity

java.lang.Object
  extended by org.acegisecurity.domain.impl.BusinessObject
      extended by org.acegisecurity.domain.impl.AbstractPersistableEntity
All Implemented Interfaces:
Serializable, Cloneable, PersistableEntity
Direct Known Subclasses:
PersistableEntityInteger, PersistableEntityLong

public abstract class AbstractPersistableEntity
extends BusinessObject
implements PersistableEntity

An abstract implementation of PersistableEntity.

Version:
$Id: AbstractPersistableEntity.java,v 1.5 2005/11/17 00:55:49 benalex Exp $
Author:
Ben Alex
See Also:
Serialized Form

Field Summary
static int STARTING_VERSION
           
 
Fields inherited from class org.acegisecurity.domain.impl.BusinessObject
logger
 
Constructor Summary
AbstractPersistableEntity()
           
 
Method Summary
 int getVersion()
          Returns the version number, which should be managed by the persistence layer.
 boolean isNew()
          Indicates whether this persistable entity has been persisted yet.
 void setVersion(int version)
          Sets the version numbers.
 
Methods inherited from class org.acegisecurity.domain.impl.BusinessObject
clone, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.acegisecurity.domain.PersistableEntity
getInternalId
 

Field Detail

STARTING_VERSION

public static final int STARTING_VERSION
See Also:
Constant Field Values
Constructor Detail

AbstractPersistableEntity

public AbstractPersistableEntity()
Method Detail

isNew

public boolean isNew()
Indicates whether this persistable entity has been persisted yet. Determine based on whether the PersistableEntity.getInternalId() returns null or a non-null value.

Returns:
true if the instance has not been persisted, false otherwise

getVersion

public int getVersion()
Returns the version number, which should be managed by the persistence layer.

Initially all PersistableEntitys will commence with the version number defined by STARTING_VERSION.

Returns:
the version

setVersion

public void setVersion(int version)
Sets the version numbers.

Parameters:
version - the new version number to use


Copyright © 2004-2005 Acegi Technology Pty Limited. All Rights Reserved.