org.starhope.appius.sql
Class SQLPeerDatum

java.lang.Object
  extended by org.starhope.appius.sql.SQLPeerDatum
All Implemented Interfaces:
Serializable, Comparable<Object>
Direct Known Subclasses:
Filter, MailMessage, Payment, PaymentGateway, SQLPeerEnum, UserAddress

Deprecated. use DataRecord

@Deprecated
public abstract class SQLPeerDatum
extends Object
implements Serializable, Comparable<Object>

This is the base class from which all classes that reflect data from the SQL backing store are derived. It extends ManagedReferenceHolder for Project Darkstar support, and as a result, also implements Serializable.

Author:
brpocock@star-hope.org
See Also:
Serialized Form

Field Summary
private static long serialVersionUID
          Deprecated. The serialization UID for this class.
 
Constructor Summary
SQLPeerDatum()
          Deprecated.  
 
Method Summary
 void changed()
          Deprecated. Indicate that some of the contents of this datum have changed, and that the database and/or object caches may need to be updated.
 int compareTo(Object o)
          Deprecated. This is an overriding method.
protected
<T extends SQLPeerDatum>
SQLPeerDatum
findInCache()
          Deprecated. Find the object in the cache, if possible.
abstract  void flush()
          Deprecated.  
static SQLPeerDatum get(Class<? extends SQLPeerDatum> klass, org.json.JSONObject object)
          Deprecated. This method should return an SQLPeerDatum-derived object based upon its class and a serialized JSON form.
private  String getCacheGlobalID()
          Deprecated. Get the globally-unique ID for this object, including the canonical class name, for the cache.
protected abstract  String getCacheUniqueID()
          Deprecated.  
protected  void saveInCache()
          Deprecated. Store the local object into the cache
 void set(org.json.JSONObject jso)
          Deprecated.  
protected abstract  void set(ResultSet rs)
          Deprecated.  
 org.json.JSONObject toJSON()
          Deprecated. This is the default SQLPeerDatum implementation of toJSON.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Deprecated. 
The serialization UID for this class. serialVersionUID (long)

See Also:
Constant Field Values
Constructor Detail

SQLPeerDatum

public SQLPeerDatum()
Deprecated. 
Method Detail

get

public static SQLPeerDatum get(Class<? extends SQLPeerDatum> klass,
                               org.json.JSONObject object)
Deprecated. 
This method should return an SQLPeerDatum-derived object based upon its class and a serialized JSON form.

This method is unimplemented, and will throw an Error.

Parameters:
klass - The class of object to be gotten
object - The JSON form of that object's data
Returns:
the object as an SQLPeerDatum-derived class, suitable for casting to ‘klass.’

changed

public void changed()
Deprecated. 
Indicate that some of the contents of this datum have changed, and that the database and/or object caches may need to be updated.


compareTo

public int compareTo(Object o)
Deprecated. 
This is an overriding method.

Specified by:
compareTo in interface Comparable<Object>
See Also:
Comparable.compareTo(java.lang.Object)

findInCache

protected <T extends SQLPeerDatum> SQLPeerDatum findInCache()
                            throws NotFoundException
Deprecated. 
Find the object in the cache, if possible. If not, throws a NotFoundException.

Type Parameters:
T - type
Returns:
the object, if already found
Throws:
NotFoundException - if it's not found

flush

public abstract void flush()
Deprecated. 

getCacheGlobalID

private String getCacheGlobalID()
Deprecated. 
Get the globally-unique ID for this object, including the canonical class name, for the cache.

Returns:
the ID for the cache

getCacheUniqueID

protected abstract String getCacheUniqueID()
Deprecated. 
Returns:
The local (Stringified) version of an unique ID; usually the database ID column

saveInCache

protected void saveInCache()
Deprecated. 
Store the local object into the cache


set

public void set(org.json.JSONObject jso)
Deprecated. 
Parameters:
jso - The JSON data to be used to set the value of this object

set

protected abstract void set(ResultSet rs)
                     throws SQLException
Deprecated. 
Parameters:
rs - The result of an SQL query, with the cursor already pointed at the row describing this specific instance of the object.
Throws:
SQLException - if the database fails somehow

toJSON

public org.json.JSONObject toJSON()
Deprecated. 
This is the default SQLPeerDatum implementation of toJSON. This uses Java reflection and “bean-type” methods to extract the contents of an object and create a JSON field.

Returns:
This object's data, serialized into JSON form.