org.equanda.persistence
Class EquandaProxy<ID,PROXY extends EquandaProxy>

java.lang.Object
  extended by org.equanda.persistence.EquandaProxy<ID,PROXY>
All Implemented Interfaces:
Serializable, HasId<ID>

public abstract class EquandaProxy<ID,PROXY extends EquandaProxy>
extends Object
implements HasId<ID>, Serializable

Base class for proxies.

Author:
Andrei Chiritescu
See Also:
Serialized Form

Field Summary
protected  Timestamp equandaModificationDate
           
protected  boolean equandaStatusModified
           
protected  ObjectType equandaType
           
protected  long equandaVersion
           
protected  ID id
           
protected  boolean update
           
 
Constructor Summary
EquandaProxy()
           
 
Method Summary
 boolean equals(Object o)
           
 PROXY equandaClone()
           
abstract  PROXY equandaClone(boolean cloneUoid)
           
abstract  void equandaReset()
          Reset the proxy state.
 void equandaUpdate()
          Update the proxy state, client changes are persisted, and server changes retrieved.
abstract  void equandaUpdate(boolean updateTypeFieldsOnly)
           
 Timestamp getEquandaModificationDate()
           
 String getEquandaName()
           
abstract  String getEquandaStatus()
           
 String getEquandaType()
           
 long getEquandaVersion()
           
 ID getId()
          Get unique object identifier for this object.
 int hashCode()
           
 boolean isEquandaModificationDateModified()
           
 boolean isEquandaType(String type)
           
 boolean isModified()
           
abstract  boolean isModified(boolean typeFieldsOnly)
           
protected  boolean objectEquals(Object obj1, Object obj2)
          utility routine to test equality of objects without relying on one of them being not null.
 void removeEntityBean()
           
abstract  void setEquandaStatus(String status)
           
abstract  void setEquandaType(String type)
          Set the type of object which should be used.
 void setEquandaUpdate(boolean update)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected ID id

equandaType

protected ObjectType equandaType

equandaModificationDate

protected Timestamp equandaModificationDate

equandaVersion

protected long equandaVersion

equandaStatusModified

protected boolean equandaStatusModified

update

protected boolean update
Constructor Detail

EquandaProxy

public EquandaProxy()
Method Detail

getId

public ID getId()
Description copied from interface: HasId
Get unique object identifier for this object.

Specified by:
getId in interface HasId<ID>
Returns:
id

getEquandaModificationDate

public Timestamp getEquandaModificationDate()

getEquandaVersion

public long getEquandaVersion()

isEquandaModificationDateModified

public boolean isEquandaModificationDateModified()

getEquandaStatus

public abstract String getEquandaStatus()

setEquandaStatus

public abstract void setEquandaStatus(String status)

getEquandaType

public String getEquandaType()

getEquandaName

public String getEquandaName()

isEquandaType

public boolean isEquandaType(String type)

toString

public String toString()
Overrides:
toString in class Object

setEquandaType

public abstract void setEquandaType(String type)
Set the type of object which should be used. This is a helper routine to allow using isEquandaType() for checking of object type. This method is only allowed for object building (not for objects which already exists on the server. When an invalid type identifier is specified, then later calls to read the type will throw IllegalStateException.

Parameters:
type - base type which will be used to build the actual object
Throws:
IllegalStateException

isModified

public abstract boolean isModified(boolean typeFieldsOnly)

isModified

public boolean isModified()

objectEquals

protected boolean objectEquals(Object obj1,
                               Object obj2)
utility routine to test equality of objects without relying on one of them being not null.

Parameters:
obj1 - one of the objects to compare
obj2 - other object to compare
Returns:
true when bot objects are equal

equandaClone

public PROXY equandaClone()

equandaClone

public abstract PROXY equandaClone(boolean cloneUoid)

equandaUpdate

public void equandaUpdate()
                   throws EquandaException
Update the proxy state, client changes are persisted, and server changes retrieved.

Throws:
EquandaException - update problems

equandaUpdate

public abstract void equandaUpdate(boolean updateTypeFieldsOnly)
                            throws EquandaException
Throws:
EquandaException

equandaReset

public abstract void equandaReset()
                           throws EquandaException
Reset the proxy state. If the proxy was not modified, nothing happens, otherwise the state is retrieved from the server again.

Throws:
EquandaException - oops

removeEntityBean

public void removeEntityBean()
                      throws EquandaException
Throws:
EquandaException

setEquandaUpdate

public void setEquandaUpdate(boolean update)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2007-2009. All Rights Reserved.