org.persvr.data
Interface Persistable

All Known Subinterfaces:
ObservablePersistable, PersistableList<K>
All Known Implementing Classes:
CapabilityObject, CapabilityUser, LazyNativeObject, NonCachingNativeObject, PersistableArray, PersistableObject, ReadonlyObject, Schema, SMD

public interface Persistable

This is interface that all persistable objects should implement

Author:
Kris Zyp

Field Summary
static int ENTRY_SET_INCLUDE_DONT_ENUM
           
static int ENTRY_SET_INCLUDE_GETTER_SETTER_FUNCTIONS
           
 
Method Summary
 void delete()
          Deletes the current object.
 java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet(int options)
           
 java.lang.Object get(java.lang.String key)
          Gets a field without using JS getters
 int getAccessLevel()
          Get the access level of the object
 PersistableList<Persistable> getHistory()
          Returns a history of changes to the object
 ObjectId getId()
           
 java.util.Date getLastModified()
          Gets the last committed modification to the object
 Persistable getParent()
          Returns the parent of this object.
 Persistable getSchema()
          Returns the schema for this object
 java.lang.Object noCheckGet(java.lang.String key)
          Deprecated. 
 void onCreation()
          Called when an persistent object is first created (not when the Java object is created to restore state)
 java.lang.Object set(java.lang.String name, java.lang.Object value)
          Sets a value into a field persistently (even it has been declared persistent in the structure) without using JS setters
 

Field Detail

ENTRY_SET_INCLUDE_DONT_ENUM

static final int ENTRY_SET_INCLUDE_DONT_ENUM
See Also:
Constant Field Values

ENTRY_SET_INCLUDE_GETTER_SETTER_FUNCTIONS

static final int ENTRY_SET_INCLUDE_GETTER_SETTER_FUNCTIONS
See Also:
Constant Field Values
Method Detail

get

java.lang.Object get(java.lang.String key)
Gets a field without using JS getters

Parameters:
key -
Returns:

set

java.lang.Object set(java.lang.String name,
                     java.lang.Object value)
Sets a value into a field persistently (even it has been declared persistent in the structure) without using JS setters

Parameters:
key -
Returns:

entrySet

java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet(int options)

getId

ObjectId getId()

getAccessLevel

int getAccessLevel()
Get the access level of the object

Returns:

getLastModified

java.util.Date getLastModified()
Gets the last committed modification to the object

Returns:

getSchema

Persistable getSchema()
Returns the schema for this object

Returns:

getParent

Persistable getParent()
Returns the parent of this object. Persevere has three internal uses for parents:

Returns:

delete

void delete()
Deletes the current object. This is included for REST compatibility, but this can be a very slow operation because it must track down references. It is much faster to delete a reference to an object so it does not need to determine references itself.


getHistory

PersistableList<Persistable> getHistory()
Returns a history of changes to the object

Returns:

onCreation

void onCreation()
Called when an persistent object is first created (not when the Java object is created to restore state)


noCheckGet

@Deprecated
java.lang.Object noCheckGet(java.lang.String key)
Deprecated.