wt.pds
Class AbstractPersistentStore

java.lang.Object
  extended bywt.pds.AbstractPersistentStore
All Implemented Interfaces:
PersistentStoreIfc
Direct Known Subclasses:
WTPreparedStatement

public abstract class AbstractPersistentStore
extends Object
implements PersistentStoreIfc


Field Summary
static String INLINE_BLOB_OVERFLOW
           
static int MAX_SQL_STRING_SIZE
           
 
Fields inherited from interface wt.pds.PersistentStoreIfc
versionID
 
Constructor Summary
AbstractPersistentStore()
           
 
Method Summary
abstract  String getContainer()
          Get the current container name.
 WTConnection getUserConnection()
           
private static MethodContext getUserContext()
           
abstract  int indexOf(String attrName)
           
abstract  boolean isSkip()
           
abstract  void setAsciiStream(String attributeName, InputStream aStream, int len)
          Set the value to an ascii stream.
abstract  void setBigDecimal(String attributeName, BigDecimal aBigDecimal)
          Set the value to a BigDecimal.
abstract  void setBinaryStream(String attributeName, InputStream aStream, int len)
          Set the value to a binary stream.
abstract  void setBoolean(String attributeName, boolean aBool)
          Set the value to a Java boolean.
abstract  void setBooleanObject(String attributeName, Boolean aBool)
          Set the value to a Boolean.
abstract  void setByte(String attributeName, byte aByte)
          Set the value to a Java byte.
abstract  void setByteObject(String attributeName, Byte aByte)
          Set the value to a Byte.
abstract  void setBytes(String attributeName, byte[] bArray)
          Set the value to a Java byte array.
abstract  void setChar(String attributeName, char aChar)
          Set the value to a Java char.
abstract  void setCharObject(String attributeName, Character aChar)
          Set the value to a Character.
abstract  void setDate(String attributeName, Date aDate)
          Set the value to a java.util.Date.
abstract  void setDouble(String attributeName, double aDbl)
          Set the value to a Java double.
abstract  void setDoubleObject(String attributeName, Double aDbl)
          Set the value to a Double.
abstract  void setFloat(String attributeName, float aFloat)
          Set the value to a Java float.
abstract  void setFloatObject(String attributeName, Float aFloat)
          Set the value to a Float.
 void setInlineObject(String attributeName, String blobAttributeName, Serializable anObj)
          Set the value to a Java Serializable Object.
abstract  void setInt(String attributeName, int anInt)
          Set the value to a Java int.
abstract  void setIntObject(String attributeName, Integer anInt)
          Set the value to a Integer.
abstract  void setLobLocator(String attributeName, LobLocator aLL)
          Set the value to a Lob locator.
abstract  void setLong(String attributeName, long aLong)
          Set the value to a Java long.
abstract  void setLongObject(String attributeName, Long aLong)
          Set the value to a Long.
abstract  void setNull(int idx, int sqlType)
           
abstract  void setNull(String attributeName, int sqltype)
          Set the value to a null.
abstract  void setObject(String attributeName, Object anObj)
          Set the value to a Java object.
abstract  void setShort(String attributeName, short aShort)
          Set the value to a Java short.
abstract  void setShortObject(String attributeName, Short aShort)
          Set the value to a Short.
abstract  void setSmallObject(String attributeName, Serializable anObj)
          Set the value to a Java object.
abstract  void setString(int idx, String a_string)
           
abstract  void setString(String attributeName, String aString)
          Set the value to a Java String.
abstract  void setTime(String attributeName, Time aTime)
          Set the value to a Java Timee.
abstract  void setTimestamp(String attributeName, Timestamp aTimestamp)
          Set the value to a Java Timestamp.
abstract  void setUnicodeStream(String attributeName, InputStream aStream, int len)
          Set the value to a Java Unicode stream.
abstract  void writeObject(String attribute_name, ObjectMappable obj, Class concrete_class, boolean isRequired)
          Set the values corresponding to a nested ObjectMappable Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INLINE_BLOB_OVERFLOW

public static final String INLINE_BLOB_OVERFLOW
See Also:
Constant Field Values

MAX_SQL_STRING_SIZE

public static final int MAX_SQL_STRING_SIZE
Constructor Detail

AbstractPersistentStore

public AbstractPersistentStore()
Method Detail

setAsciiStream

public abstract void setAsciiStream(String attributeName,
                                    InputStream aStream,
                                    int len)
                             throws SQLException
Set the value to an ascii stream. This maps to SQL type LONGVARCHAR.

Specified by:
setAsciiStream in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aStream - the parameter value
len - the length of the input stream
Throws:
SQLException - if a database-access error occurs.

setBigDecimal

public abstract void setBigDecimal(String attributeName,
                                   BigDecimal aBigDecimal)
                            throws SQLException
Set the value to a BigDecimal. This maps to SQL type Number(precision,scale).

Specified by:
setBigDecimal in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aBigDecimal - the parameter value
Throws:
SQLException - if a database-access error occurs.

setBinaryStream

public abstract void setBinaryStream(String attributeName,
                                     InputStream aStream,
                                     int len)
                              throws SQLException
Set the value to a binary stream. This maps to SQL type LONGVARBINARY

Specified by:
setBinaryStream in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aStream - the parameter value
len - the length of the input stream
Throws:
SQLException - if a database-access error occurs.

setBoolean

public abstract void setBoolean(String attributeName,
                                boolean aBool)
                         throws SQLException
Set the value to a Java boolean. This maps to SQL type BIT

Specified by:
setBoolean in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aBool - the parameter value
Throws:
SQLException - if a database-access error occurs.

setBooleanObject

public abstract void setBooleanObject(String attributeName,
                                      Boolean aBool)
                               throws SQLException
Set the value to a Boolean. This maps to SQL type BIT

Specified by:
setBooleanObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aBool - the parameter value
Throws:
SQLException - if a database-access error occurs.

setByte

public abstract void setByte(String attributeName,
                             byte aByte)
                      throws SQLException
Set the value to a Java byte. This maps to SQL type TINYINT

Specified by:
setByte in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aByte - the parameter value
Throws:
SQLException - if a database-access error occurs.

setByteObject

public abstract void setByteObject(String attributeName,
                                   Byte aByte)
                            throws SQLException
Set the value to a Byte. This maps to SQL type TINYINT

Specified by:
setByteObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aByte - the parameter value
Throws:
SQLException - if a database-access error occurs.

setBytes

public abstract void setBytes(String attributeName,
                              byte[] bArray)
                       throws SQLException
Set the value to a Java byte array. This maps to either SQL type LONGVARBINARY or BLOB

Specified by:
setBytes in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
bArray - the parameter value
Throws:
SQLException - if a database-access error occurs.

setChar

public abstract void setChar(String attributeName,
                             char aChar)
                      throws SQLException
Set the value to a Java char. This maps to SQL type CHAR(1)

Specified by:
setChar in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aChar - the parameter value
Throws:
SQLException - if a database-access error occurs.

setCharObject

public abstract void setCharObject(String attributeName,
                                   Character aChar)
                            throws SQLException
Set the value to a Character. This maps to SQL type CHAR(1)

Specified by:
setCharObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aChar - the parameter value
Throws:
SQLException - if a database-access error occurs.

setDate

public abstract void setDate(String attributeName,
                             Date aDate)
                      throws SQLException
Set the value to a java.util.Date. This maps to SQL type DATE

Specified by:
setDate in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aDate - the parameter value
Throws:
SQLException - if a database-access error occurs.

setDouble

public abstract void setDouble(String attributeName,
                               double aDbl)
                        throws SQLException
Set the value to a Java double. This maps to SQL type DOUBLE

Specified by:
setDouble in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aDbl - the parameter value
Throws:
SQLException - if a database-access error occurs.

setDoubleObject

public abstract void setDoubleObject(String attributeName,
                                     Double aDbl)
                              throws SQLException
Set the value to a Double. This maps to SQL type DOUBLE

Specified by:
setDoubleObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aDbl - the parameter value
Throws:
SQLException - if a database-access error occurs.

setFloat

public abstract void setFloat(String attributeName,
                              float aFloat)
                       throws SQLException
Set the value to a Java float. This maps to SQL type FLOAT

Specified by:
setFloat in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aFloat - the parameter value
Throws:
SQLException - if a database-access error occurs.

setFloatObject

public abstract void setFloatObject(String attributeName,
                                    Float aFloat)
                             throws SQLException
Set the value to a Float. This maps to SQL type FLOAT

Specified by:
setFloatObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aFloat - the parameter value
Throws:
SQLException - if a database-access error occurs.

setInlineObject

public void setInlineObject(String attributeName,
                            String blobAttributeName,
                            Serializable anObj)
                     throws SQLException,
                            DatastoreException
Set the value to a Java Serializable Object.

Specified by:
setInlineObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
blobAttributeName - a blob attribute name
anObj - the serializable object
Throws:
SQLException - if a database-access error occurs.
PersistenceException - if a database-access error occurs.
DatastoreException

setInt

public abstract void setInt(String attributeName,
                            int anInt)
                     throws SQLException
Set the value to a Java int. This maps to SQL type INTEGER

Specified by:
setInt in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
anInt - the parameter value
Throws:
SQLException - if a database-access error occurs.

setIntObject

public abstract void setIntObject(String attributeName,
                                  Integer anInt)
                           throws SQLException
Set the value to a Integer. This maps to SQL type INTEGER

Specified by:
setIntObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
anInt - the parameter value
Throws:
SQLException - if a database-access error occurs.

setLong

public abstract void setLong(String attributeName,
                             long aLong)
                      throws SQLException
Set the value to a Java long. This maps to SQL type BIGINT

Specified by:
setLong in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aLong - the parameter value
Throws:
SQLException - if a database-access error occurs.

setLongObject

public abstract void setLongObject(String attributeName,
                                   Long aLong)
                            throws SQLException
Set the value to a Long. This maps to SQL type BIGINT

Specified by:
setLongObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aLong - the parameter value
Throws:
SQLException - if a database-access error occurs.

setNull

public abstract void setNull(String attributeName,
                             int sqltype)
                      throws SQLException
Set the value to a null. This maps to SQL type SQLNULL

Specified by:
setNull in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
sqltype - the SQL type of the attribute
Throws:
SQLException - if a database-access error occurs.

setObject

public abstract void setObject(String attributeName,
                               Object anObj)
                        throws SQLException
Set the value to a Java object. This maps to SQL type LONGVARBINARY or BLOB.

Specified by:
setObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
anObj - the parameter value
Throws:
SQLException - if a database-access error occurs.

setSmallObject

public abstract void setSmallObject(String attributeName,
                                    Serializable anObj)
                             throws SQLException,
                                    DatastoreException
Set the value to a Java object. This maps to SQL type LONGVARBINARY or BLOB.

Specified by:
setSmallObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
anObj - the parameter value
Throws:
SQLException - if a database-access error occurs.
DatastoreException

setShort

public abstract void setShort(String attributeName,
                              short aShort)
                       throws SQLException
Set the value to a Java short. This maps to SQL type SMALLINT

Specified by:
setShort in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aShort - the parameter value
Throws:
SQLException - if a database-access error occurs.

setShortObject

public abstract void setShortObject(String attributeName,
                                    Short aShort)
                             throws SQLException
Set the value to a Short. This maps to SQL type SMALLINT

Specified by:
setShortObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aShort - the parameter value
Throws:
SQLException - if a database-access error occurs.

setString

public abstract void setString(String attributeName,
                               String aString)
                        throws SQLException
Set the value to a Java String. This maps to SQL type VARCHAR

Specified by:
setString in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aString - the parameter value
Throws:
SQLException - if a database-access error occurs.

setTime

public abstract void setTime(String attributeName,
                             Time aTime)
                      throws SQLException
Set the value to a Java Timee. This maps to SQL type TIME

Specified by:
setTime in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aTime - the parameter value
Throws:
SQLException - if a database-access error occurs.

setTimestamp

public abstract void setTimestamp(String attributeName,
                                  Timestamp aTimestamp)
                           throws SQLException
Set the value to a Java Timestamp. This maps to SQL type TIMESTAMP

Specified by:
setTimestamp in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aTimestamp - the parameter value
Throws:
SQLException - if a database-access error occurs.

setUnicodeStream

public abstract void setUnicodeStream(String attributeName,
                                      InputStream aStream,
                                      int len)
                               throws SQLException
Set the value to a Java Unicode stream. This maps to SQL type LONGVARCHAR

Specified by:
setUnicodeStream in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aStream - the parameter value
Throws:
SQLException - if a database-access error occurs.

setLobLocator

public abstract void setLobLocator(String attributeName,
                                   LobLocator aLL)
                            throws SQLException
Set the value to a Lob locator.

Specified by:
setLobLocator in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aLL - the parameter value
Throws:
SQLException - if a database-access error occurs.

writeObject

public abstract void writeObject(String attribute_name,
                                 ObjectMappable obj,
                                 Class concrete_class,
                                 boolean isRequired)
                          throws SQLException,
                                 DatastoreException
Set the values corresponding to a nested ObjectMappable Object. This results in a call the nested object's writeExternal method.

Specified by:
writeObject in interface PersistentStoreIfc
Parameters:
attribute_name - a class attribute name
obj - the nested object
concrete_class - the class of the object (in case obj is null)
Throws:
SQLException - if a database-access error occurs.
DatastoreException

getContainer

public abstract String getContainer()
Get the current container name. The container name is set by calls to writeObject.

Specified by:
getContainer in interface PersistentStoreIfc
Returns:
the current container name

indexOf

public abstract int indexOf(String attrName)

isSkip

public abstract boolean isSkip()

setNull

public abstract void setNull(int idx,
                             int sqlType)
                      throws SQLException
Throws:
SQLException

setString

public abstract void setString(int idx,
                               String a_string)
                        throws SQLException
Throws:
SQLException

getUserConnection

public WTConnection getUserConnection()
                               throws DatastoreException
Throws:
DatastoreException

getUserContext

private static MethodContext getUserContext()