wt.pds
Class AbstractPersistentRetrieve

java.lang.Object
  extended bywt.pds.AbstractPersistentRetrieve
All Implemented Interfaces:
PersistentRetrieveIfc
Direct Known Subclasses:
WTResultSet

public abstract class AbstractPersistentRetrieve
extends Object
implements PersistentRetrieveIfc


Field Summary
private static String BLOB_PREFIX
           
private  boolean checkLobsDisabled
           
protected static Object LOBS_DISABLED_KEY
           
private  boolean lobsDisabled
           
 
Fields inherited from interface wt.pds.PersistentRetrieveIfc
versionID
 
Constructor Summary
AbstractPersistentRetrieve()
           
 
Method Summary
abstract  void close()
          Immediately release a ResultSet's datastore and connection resources
abstract  InputStream getAsciiStream(String attributeName)
          Get the value of a column in the current row as a stream of ASCII characters.
abstract  BigDecimal getBigDecimal(String attributeName)
          Get the value of a column in the current row as a BigDecimal
abstract  InputStream getBinaryStream(String attributeName)
          Get the value of a column in the current row as a stream of uninterpreted bytes.
abstract  boolean getBlobRewriteEnabled()
           
abstract  boolean getBoolean(String attributeName)
          Get the value of a column in the current row as a Java boolean.
abstract  Boolean getBooleanObject(String attributeName)
          Get the value of a column in the current row as a Boolean.
abstract  boolean getBuildMaps()
           
abstract  byte getByte(String attributeName)
          Get the value of a column in the current row as a Java byte.
abstract  Byte getByteObject(String attributeName)
          Get the value of a column in the current row as a Byte.
abstract  byte[] getBytes(String attributeName)
          Get the value of a column in the current row as a Java byte array.
abstract  char getChar(String attributeName)
          Get the value of a column in the current row as a Java char.
abstract  Character getCharObject(String attributeName)
          Get the value of a column in the current row as a Character.
abstract  String getContainer()
          Get the current container name.
abstract  Date getDate(String attributeName)
          Get the value of a column in the current row as a java.sql.Date object.
abstract  double getDouble(String attributeName)
          Get the value of a column in the current row as a Java double.
abstract  Double getDoubleObject(String attributeName)
          Get the value of a column in the current row as a Double.
abstract  float getFloat(String attributeName)
          Get the value of a column in the current row as a Java float.
abstract  Float getFloatObject(String attributeName)
          Get the value of a column in the current row as a Float.
abstract  String getFullAttrName(String attrName)
           
 Object getInlineObject(String attributeName, String blobAttributeName)
          Get the value of a blob column as a Java Object.
abstract  int getInt(String attributeName)
          Get the value of a column in the current row as a Java int.
abstract  Integer getIntObject(String attributeName)
          Get the value of a column in the current row as an Integer.
abstract  LobLocator getLobLocator(String attributeName)
          Get a LobLocator for the given attribute.
protected  boolean getLobsDisabled()
           
abstract  long getLong(String attributeName)
          Get the value of a column in the current row as a Java long.
abstract  Long getLongObject(String attributeName)
          Get the value of a column in the current row as a Long.
abstract  Object getObject(String attributeName)
          Get the value of a column in the current row as a Java object.
abstract  short getShort(String attributeName)
          Get the value of a column in the current row as a Java short.
abstract  Short getShortObject(String attributeName)
          Get the value of a column in the current row as a Short.
abstract  Object getSmallObject(String attributeName)
          Get the value of a column in the current row as a Java object.
abstract  String getString(String attributeName)
          Get the value of a column in the current row as a Java String.
abstract  Time getTime(String attributeName)
          Get the value of a column in the current row as a java.sql.Time object.
abstract  Timestamp getTimestamp(String attributeName)
          Get the value of a column in the current row as a java.sql.Timestamp object.
abstract  ObjectMappable getTopObject()
           
abstract  InputStream getUnicodeStream(String attributeName)
          Get the value of a column in the current row as a stream of Unicode characters and then read in chunks.
 WTConnection getUserConnection()
           
private static MethodContext getUserContext()
           
abstract  boolean next()
          A ResultSet is initially positioned before its first row; the first call to next makes the first row the current row; the second call makes the second row the current row, etc.
abstract  ObjectMappable readObject(String attribute_name, ObjectMappable obj, Class concrete_class, boolean isRequired)
          Get the values corresponding to a nested ObjectMappable Object.
 Object rewriteBlob(String attrName, String value)
           
abstract  boolean wasNull()
          A column may have the value of SQL NULL; wasNull reports whether the last column read had this special value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLOB_PREFIX

private static final String BLOB_PREFIX
See Also:
Constant Field Values

LOBS_DISABLED_KEY

protected static Object LOBS_DISABLED_KEY

lobsDisabled

private boolean lobsDisabled

checkLobsDisabled

private boolean checkLobsDisabled
Constructor Detail

AbstractPersistentRetrieve

public AbstractPersistentRetrieve()
Method Detail

getAsciiStream

public abstract InputStream getAsciiStream(String attributeName)
                                    throws SQLException
Get the value of a column in the current row as a stream of ASCII characters.

Specified by:
getAsciiStream in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is null
Throws:
SQLException - if a database-access error occurs.

getBigDecimal

public abstract BigDecimal getBigDecimal(String attributeName)
                                  throws SQLException
Get the value of a column in the current row as a BigDecimal

Specified by:
getBigDecimal in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is null
Throws:
SQLException - if a database-access error occurs.

getBinaryStream

public abstract InputStream getBinaryStream(String attributeName)
                                     throws SQLException
Get the value of a column in the current row as a stream of uninterpreted bytes.

Specified by:
getBinaryStream in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is null
Throws:
SQLException - if a database-access error occurs.

getBoolean

public abstract boolean getBoolean(String attributeName)
                            throws SQLException
Get the value of a column in the current row as a Java boolean.

Specified by:
getBoolean in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is false
Throws:
SQLException - if a database-access error occurs.

getBooleanObject

public abstract Boolean getBooleanObject(String attributeName)
                                  throws SQLException
Get the value of a column in the current row as a Boolean.

Specified by:
getBooleanObject in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, then null is returned
Throws:
SQLException - if a database-access error occurs.

getByte

public abstract byte getByte(String attributeName)
                      throws SQLException
Get the value of a column in the current row as a Java byte.

Specified by:
getByte in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is 0
Throws:
SQLException - if a database-access error occurs.

getByteObject

public abstract Byte getByteObject(String attributeName)
                            throws SQLException
Get the value of a column in the current row as a Byte.

Specified by:
getByteObject in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, then null is returned
Throws:
SQLException - if a database-access error occurs.

getBytes

public abstract byte[] getBytes(String attributeName)
                         throws SQLException,
                                DatastoreException
Get the value of a column in the current row as a Java byte array.

Specified by:
getBytes in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is null
Throws:
SQLException - if a database-access error occurs.
DatastoreException

getChar

public abstract char getChar(String attributeName)
                      throws SQLException
Get the value of a column in the current row as a Java char.

Specified by:
getChar in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is 0
Throws:
SQLException - if a database-access error occurs.

getCharObject

public abstract Character getCharObject(String attributeName)
                                 throws SQLException
Get the value of a column in the current row as a Character.

Specified by:
getCharObject in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, then null is returned
Throws:
SQLException - if a database-access error occurs.

getDate

public abstract Date getDate(String attributeName)
                      throws SQLException
Get the value of a column in the current row as a java.sql.Date object.

Specified by:
getDate in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is null
Throws:
SQLException - if a database-access error occurs.

getDouble

public abstract double getDouble(String attributeName)
                          throws SQLException
Get the value of a column in the current row as a Java double.

Specified by:
getDouble in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is 0
Throws:
SQLException - if a database-access error occurs.

getDoubleObject

public abstract Double getDoubleObject(String attributeName)
                                throws SQLException
Get the value of a column in the current row as a Double.

Specified by:
getDoubleObject in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, then null is returned
Throws:
SQLException - if a database-access error occurs.

getFloat

public abstract float getFloat(String attributeName)
                        throws SQLException
Get the value of a column in the current row as a Java float.

Specified by:
getFloat in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is 0
Throws:
SQLException - if a database-access error occurs.

getFloatObject

public abstract Float getFloatObject(String attributeName)
                              throws SQLException
Get the value of a column in the current row as a Float.

Specified by:
getFloatObject in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, then null is returned
Throws:
SQLException - if a database-access error occurs.

getInlineObject

public Object getInlineObject(String attributeName,
                              String blobAttributeName)
                       throws SQLException,
                              DatastoreException
Get the value of a blob column as a Java Object.

Specified by:
getInlineObject in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
blobAttributeName - a blob attribute name
Throws:
SQLException - if a database-access error occurs.
PersistenceException - if a database-access error occurs.
DatastoreException

getInt

public abstract int getInt(String attributeName)
                    throws SQLException
Get the value of a column in the current row as a Java int.

Specified by:
getInt in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is 0
Throws:
SQLException - if a database-access error occurs.

getIntObject

public abstract Integer getIntObject(String attributeName)
                              throws SQLException
Get the value of a column in the current row as an Integer.

Specified by:
getIntObject in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, then null is returned
Throws:
SQLException - if a database-access error occurs.

getLong

public abstract long getLong(String attributeName)
                      throws SQLException
Get the value of a column in the current row as a Java long.

Specified by:
getLong in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is 0
Throws:
SQLException - if a database-access error occurs.

getLongObject

public abstract Long getLongObject(String attributeName)
                            throws SQLException
Get the value of a column in the current row as a Long.

Specified by:
getLongObject in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, then null is returned
Throws:
SQLException - if a database-access error occurs.

getObject

public abstract Object getObject(String attributeName)
                          throws SQLException,
                                 DatastoreException
Get the value of a column in the current row as a Java object.

Specified by:
getObject in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is null
Throws:
SQLException - if a database-access error occurs.
DatastoreException

getSmallObject

public abstract Object getSmallObject(String attributeName)
                               throws SQLException,
                                      DatastoreException
Get the value of a column in the current row as a Java object.

Specified by:
getSmallObject in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is null
Throws:
SQLException - if a database-access error occurs.
DatastoreException

getShort

public abstract short getShort(String attributeName)
                        throws SQLException
Get the value of a column in the current row as a Java short.

Specified by:
getShort in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is 0
Throws:
SQLException - if a database-access error occurs.

getShortObject

public abstract Short getShortObject(String attributeName)
                              throws SQLException
Get the value of a column in the current row as a Short.

Specified by:
getShortObject in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, then null is returned
Throws:
SQLException - if a database-access error occurs.

getString

public abstract String getString(String attributeName)
                          throws SQLException
Get the value of a column in the current row as a Java String.

Specified by:
getString in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is null
Throws:
SQLException - if a database-access error occurs.

getTime

public abstract Time getTime(String attributeName)
                      throws SQLException
Get the value of a column in the current row as a java.sql.Time object.

Specified by:
getTime in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is null
Throws:
SQLException - if a database-access error occurs.

getTimestamp

public abstract Timestamp getTimestamp(String attributeName)
                                throws SQLException
Get the value of a column in the current row as a java.sql.Timestamp object.

Specified by:
getTimestamp in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is null
Throws:
SQLException - if a database-access error occurs.

getUnicodeStream

public abstract InputStream getUnicodeStream(String attributeName)
                                      throws SQLException
Get the value of a column in the current row as a stream of Unicode characters and then read in chunks.

Specified by:
getUnicodeStream in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Returns:
the column value; if the value is SQL NULL, the result is null
Throws:
SQLException - if a database-access error occurs.

getLobLocator

public abstract LobLocator getLobLocator(String attributeName)
                                  throws SQLException,
                                         DatastoreException
Get a LobLocator for the given attribute.

Specified by:
getLobLocator in interface PersistentRetrieveIfc
Parameters:
attributeName - a class attribute name
Throws:
SQLException - if a database-access error occurs.
DatastoreException

readObject

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

Specified by:
readObject in interface PersistentRetrieveIfc
Parameters:
attribute_name - a class attribute name
obj - the nested object
concrete_class - the class to instantiate if needed
Throws:
SQLException - if a database-access error occurs.
DatastoreException - if any other internal error occurs.

getContainer

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

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

next

public abstract boolean next()
                      throws SQLException
A ResultSet is initially positioned before its first row; the first call to next makes the first row the current row; the second call makes the second row the current row, etc.

Specified by:
next in interface PersistentRetrieveIfc
Returns:
true if new row is valid, false if there are no more rows
Throws:
SQLException - if a database-access error occurs.

close

public abstract void close()
                    throws SQLException
Immediately release a ResultSet's datastore and connection resources

Specified by:
close in interface PersistentRetrieveIfc
Throws:
SQLException - if a database-access error occurs.

wasNull

public abstract boolean wasNull()
                         throws SQLException
A column may have the value of SQL NULL; wasNull reports whether the last column read had this special value. Note that you must first call getXXX on a column to try to read its value and then call wasNull() to find if the value was the SQL NULL.

Specified by:
wasNull in interface PersistentRetrieveIfc
Returns:
true if last column was a null value
Throws:
SQLException - if a database-access error occurs.

getTopObject

public abstract ObjectMappable getTopObject()

getBlobRewriteEnabled

public abstract boolean getBlobRewriteEnabled()

rewriteBlob

public Object rewriteBlob(String attrName,
                          String value)
                   throws SQLException,
                          DatastoreException
Throws:
SQLException
DatastoreException

getUserConnection

public WTConnection getUserConnection()
                               throws DatastoreException
Throws:
DatastoreException

getLobsDisabled

protected boolean getLobsDisabled()

getUserContext

private static MethodContext getUserContext()

getBuildMaps

public abstract boolean getBuildMaps()

getFullAttrName

public abstract String getFullAttrName(String attrName)