org.apache.openjpa.jdbc.sql
Class AbstractResult

java.lang.Object
  extended by org.apache.openjpa.jdbc.sql.AbstractResult
All Implemented Interfaces:
Result, Closeable
Direct Known Subclasses:
ResultSetResult

public abstract class AbstractResult
extends Object
implements Result

A Result implementation designed to be subclassed easily by implementations. All get<type> calls are delegated to the getObjectInternal(Object,int,Object,Joins) method, which should be implemented by subclasses along with nextInternal(), containsInternal(java.lang.Object, org.apache.openjpa.jdbc.sql.Joins), and Result.size(). Most of the methods of this class will accept return values from getObjectInternal(Object,int,Object,Joins) that are not exactly the right type. For example, any numeric type can be returned as any Number type, and dates, locales, characters, and booleans can be returned as strings.

Author:
Abe White
See Also:
ResultSetResult

Constructor Summary
AbstractResult()
           
 
Method Summary
 boolean absolute(int row)
          Move to the given 0-based row in the result, or return false if the row does not exist.
protected  boolean absoluteInternal(int row)
          Throws an exception by default.
protected  Object checkNull(Object val)
           
 void close()
          Closes all eager results.
protected  void closeEagerMap(Map eager)
          Close all results in eager map.
 boolean contains(Column col, Joins joins)
          Return true if the given column is available in the result.
 boolean contains(Object obj)
          Return true if the given id or column is available in the result.
 boolean containsAll(Column[] cols, Joins joins)
          Return true if all the given columns are available in the result.
 boolean containsAll(Object[] objs)
          Return true if all the given ids or columns are available in the result.
protected  boolean containsAllInternal(Object[] objs, Joins joins)
          Return whether this result contains data for all the given ids or columns.
protected abstract  boolean containsInternal(Object obj, Joins joins)
          Return whether this result contains data for the given id or column.
 void endDataRequest()
          Ends a data request.
 Array getArray(Column col, Joins joins)
          Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.
 Array getArray(Object obj)
          Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.
protected  Array getArrayInternal(Object obj, Joins joins)
           
 InputStream getAsciiStream(Column col, Joins joins)
          Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.
 InputStream getAsciiStream(Object obj)
          Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.
protected  InputStream getAsciiStreamInternal(Object obj, Joins joins)
           
 ClassMapping getBaseMapping()
          If this is the result of a UNION used to select a hierarchy of mappings, the base mapping represented by the current row.
 BigDecimal getBigDecimal(Column col, Joins joins)
          Return the value stored in the given column.
 BigDecimal getBigDecimal(Object obj)
          Return the value stored in the given column or id.
protected  BigDecimal getBigDecimalInternal(Object obj, Joins joins)
           
 BigInteger getBigInteger(Column col, Joins joins)
          Return the value stored in the given column.
 BigInteger getBigInteger(Object obj)
          Return the value stored in the given column or id.
protected  BigInteger getBigIntegerInternal(Object obj, Joins joins)
           
 InputStream getBinaryStream(Column col, Joins joins)
          Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.
 InputStream getBinaryStream(Object obj)
          Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.
protected  InputStream getBinaryStreamInternal(Object obj, Joins joins)
           
 Blob getBlob(Column col, Joins joins)
          Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.
 Blob getBlob(Object obj)
          Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.
protected  Blob getBlobInternal(Object obj, Joins joins)
           
 boolean getBoolean(Column col, Joins joins)
          Return the value stored in the given column.
 boolean getBoolean(Object obj)
          Return the value stored in the given column or id.
protected  boolean getBooleanInternal(Object obj, Joins joins)
           
 byte getByte(Column col, Joins joins)
          Return the value stored in the given column.
 byte getByte(Object obj)
          Return the value stored in the given column or id.
protected  byte getByteInternal(Object obj, Joins joins)
           
 byte[] getBytes(Column col, Joins joins)
          Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.
 byte[] getBytes(Object obj)
          Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.
protected  byte[] getBytesInternal(Object obj, Joins joins)
           
 Calendar getCalendar(Column col, Joins joins)
          Return the value stored in the given column.
 Calendar getCalendar(Object obj)
          Return the value stored in the given column or id.
protected  Calendar getCalendarInternal(Object obj, Joins joins)
           
 char getChar(Column col, Joins joins)
          Return the value stored in the given column.
 char getChar(Object obj)
          Return the value stored in the given column or id.
 Reader getCharacterStream(Column col, Joins joins)
          Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.
 Reader getCharacterStream(Object obj)
          Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.
protected  Reader getCharacterStreamInternal(Object obj, Joins joins)
           
protected  char getCharInternal(Object obj, Joins joins)
           
 Clob getClob(Column col, Joins joins)
          Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.
 Clob getClob(Object obj)
          Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.
protected  Clob getClobInternal(Object obj, Joins joins)
           
 Date getDate(Column col, Calendar cal, Joins joins)
          Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.
 Date getDate(Column col, Joins joins)
          Return the value stored in the given column.
 Date getDate(Object obj)
          Return the value stored in the given column or id.
 Date getDate(Object obj, Calendar cal)
          Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.
protected  Date getDateInternal(Object obj, Calendar cal, Joins joins)
           
protected  Date getDateInternal(Object obj, Joins joins)
           
 double getDouble(Column col, Joins joins)
          Return the value stored in the given column.
 double getDouble(Object obj)
          Return the value stored in the given column or id.
protected  double getDoubleInternal(Object obj, Joins joins)
           
 Object getEager(FieldMapping key)
          The eager result for the given key, or null if none.
protected  Map getEagerMap(boolean client)
          Raw eager information.
 float getFloat(Column col, Joins joins)
          Return the value stored in the given column.
 float getFloat(Object obj)
          Return the value stored in the given column or id.
protected  float getFloatInternal(Object obj, Joins joins)
           
 int getInt(Column col, Joins joins)
          Return the value stored in the given column.
 int getInt(Object obj)
          Return the value stored in the given column or id.
protected  int getIntInternal(Object obj, Joins joins)
           
 InputStream getLOBStream(JDBCStore store, Object obj)
           
protected  InputStream getLOBStreamInternal(JDBCStore store, Object obj, Joins joins)
           
 Locale getLocale(Column col, Joins joins)
          Return the value stored in the given column.
 Locale getLocale(Object obj)
          Return the value stored in the given column or id.
protected  Locale getLocaleInternal(Object obj, Joins joins)
           
 long getLong(Column col, Joins joins)
          Return the value stored in the given column.
 long getLong(Object obj)
          Return the value stored in the given column or id.
protected  long getLongInternal(Object obj, Joins joins)
           
 FieldMapping getMappedByFieldMapping()
          If this is the result used to select a toMany relationship, the mappedByFieldMapping is field mapping representing the inverse relationship.
 Object getMappedByValue()
          If this is the result used to select a toMany relationship, the mappedByValue is value of the owner of the toMany relationship.
 Number getNumber(Column col, Joins joins)
          Return the value stored in the given column.
 Number getNumber(Object obj)
          Return the value stored in the given column or id.
protected  Number getNumberInternal(Object obj, Joins joins)
           
 Object getObject(Column col, Object arg, Joins joins)
          Return the value stored in the given column.
 Object getObject(Object obj, int metaType, Object arg)
          Return the value stored in the given column or id.
protected abstract  Object getObjectInternal(Object obj, int metaType, Object arg, Joins joins)
          Return the value stored in the given id or column.
 Ref getRef(Column col, Map map, Joins joins)
          Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.
 Ref getRef(Object obj, Map map)
          Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.
protected  Ref getRefInternal(Object obj, Map map, Joins joins)
           
 short getShort(Column col, Joins joins)
          Return the value stored in the given column.
 short getShort(Object obj)
          Return the value stored in the given column or id.
protected  short getShortInternal(Object obj, Joins joins)
           
 Object getSQLObject(Column col, Map map, Joins joins)
          Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.
 Object getSQLObject(Object obj, Map map)
          Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.
protected  Object getSQLObjectInternal(Object obj, Map map, Joins joins)
           
protected abstract  Object getStreamInternal(JDBCStore store, Object obj, int metaType, Object arg, Joins joins)
           
 String getString(Column col, Joins joins)
          Return the value stored in the given column.
 String getString(Object obj)
          Return the value stored in the given column or id.
protected  String getStringInternal(Object obj, Joins joins, boolean isClobString)
           
 Time getTime(Column col, Calendar cal, Joins joins)
          Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.
 Time getTime(Object obj, Calendar cal)
          Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.
protected  Time getTimeInternal(Object obj, Calendar cal, Joins joins)
           
 Timestamp getTimestamp(Column col, Calendar cal, Joins joins)
          Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.
 Timestamp getTimestamp(Object obj, Calendar cal)
          Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.
protected  Timestamp getTimestampInternal(Object obj, Calendar cal, Joins joins)
           
 int indexOf()
          The index of the select within the UNION that the current row corresponds to, or 0.
 boolean isLocking()
          If true, then any results loaded from this Result will be locked in the database.
 Object load(ClassMapping mapping, JDBCStore store, JDBCFetchConfiguration fetch)
          Load a pc object using the given store manager.
 Object load(ClassMapping mapping, JDBCStore store, JDBCFetchConfiguration fetch, Joins joins)
          Load a pc object using the given store manager.
 Joins newJoins()
          Returns a no-op joins object by default.
 boolean next()
          Advance to the next row, or return false if there are no more rows in the result.
protected abstract  boolean nextInternal()
          Advance this row.
 void pushBack()
          Push back the last result.
 void putEager(FieldMapping key, Object res)
          The eager result for the given key, or null if none.
 void setBaseMapping(ClassMapping base)
          If this is the result of a UNION used to select a hierarchy of mappings, the base mapping represented by the current row.
protected  void setEagerMap(Map eager)
          Raw eager information.
 void setIndexOf(int idx)
           
 void setLocking(boolean locking)
          Set to true if row locking has been issued for the row.
 void setMappedByFieldMapping(FieldMapping fieldMapping)
          If this is the result used to select a toMany relationship, the mappedByFieldMapping is field mapping representing the inverse relationship.
 void setMappedByValue(Object mappedByValue)
          If this is the result used to select a toMany relationship, the mappedByValue is value of the owner of the toMany relationship.
 void startDataRequest(Object mapping)
          Informs this receiver about the application element for which a subsequent data request will be made.
 boolean supportsRandomAccess()
          Returns false by default.
protected  Object translate(Object obj, Joins joins)
          Translate the user-given id or column.
 boolean wasNull()
          Return true if the last value fetched was null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.openjpa.jdbc.sql.Result
size
 

Constructor Detail

AbstractResult

public AbstractResult()
Method Detail

getEager

public Object getEager(FieldMapping key)
Description copied from interface: Result
The eager result for the given key, or null if none.

Specified by:
getEager in interface Result

putEager

public void putEager(FieldMapping key,
                     Object res)
Description copied from interface: Result
The eager result for the given key, or null if none.

Specified by:
putEager in interface Result

getEagerMap

protected Map getEagerMap(boolean client)
Raw eager information. May be null.

Parameters:
client - whether the client is accessing eager information

setEagerMap

protected void setEagerMap(Map eager)
Raw eager information.


close

public void close()
Closes all eager results.

Specified by:
close in interface Result
Specified by:
close in interface Closeable

closeEagerMap

protected void closeEagerMap(Map eager)
Close all results in eager map.


supportsRandomAccess

public boolean supportsRandomAccess()
                             throws SQLException
Returns false by default.

Specified by:
supportsRandomAccess in interface Result
Throws:
SQLException

absolute

public boolean absolute(int row)
                 throws SQLException
Description copied from interface: Result
Move to the given 0-based row in the result, or return false if the row does not exist. This method will only be called if the result supports random access.

Specified by:
absolute in interface Result
Throws:
SQLException

absoluteInternal

protected boolean absoluteInternal(int row)
                            throws SQLException
Throws an exception by default.

Throws:
SQLException

next

public boolean next()
             throws SQLException
Description copied from interface: Result
Advance to the next row, or return false if there are no more rows in the result.

Specified by:
next in interface Result
Throws:
SQLException

nextInternal

protected abstract boolean nextInternal()
                                 throws SQLException
Advance this row.

Throws:
SQLException

pushBack

public void pushBack()
              throws SQLException
Description copied from interface: Result
Push back the last result. In other words, just ignore the next call to Result.next(). After the first time this method is called, additional calls before a call to Result.next() or Result.absolute(int) should have no further affect.

Specified by:
pushBack in interface Result
Throws:
SQLException

newJoins

public Joins newJoins()
Returns a no-op joins object by default.

Specified by:
newJoins in interface Result

contains

public boolean contains(Object obj)
                 throws SQLException
Description copied from interface: Result
Return true if the given id or column is available in the result.

Specified by:
contains in interface Result
Throws:
SQLException

containsAll

public boolean containsAll(Object[] objs)
                    throws SQLException
Description copied from interface: Result
Return true if all the given ids or columns are available in the result.

Specified by:
containsAll in interface Result
Throws:
SQLException

contains

public boolean contains(Column col,
                        Joins joins)
                 throws SQLException
Description copied from interface: Result
Return true if the given column is available in the result.

Specified by:
contains in interface Result
Throws:
SQLException

containsAll

public boolean containsAll(Column[] cols,
                           Joins joins)
                    throws SQLException
Description copied from interface: Result
Return true if all the given columns are available in the result.

Specified by:
containsAll in interface Result
Throws:
SQLException

containsInternal

protected abstract boolean containsInternal(Object obj,
                                            Joins joins)
                                     throws SQLException
Return whether this result contains data for the given id or column. The id or column has not beed passed through translate(java.lang.Object, org.apache.openjpa.jdbc.sql.Joins).

Throws:
SQLException

containsAllInternal

protected boolean containsAllInternal(Object[] objs,
                                      Joins joins)
                               throws SQLException
Return whether this result contains data for all the given ids or columns. The ids or columns have not been passed through translate(java.lang.Object, org.apache.openjpa.jdbc.sql.Joins). Delegates to containsInternal(java.lang.Object, org.apache.openjpa.jdbc.sql.Joins) by default.

Throws:
SQLException

getBaseMapping

public ClassMapping getBaseMapping()
Description copied from interface: Result
If this is the result of a UNION used to select a hierarchy of mappings, the base mapping represented by the current row. This information is not available after getting any eager results from the row.

Specified by:
getBaseMapping in interface Result

setBaseMapping

public void setBaseMapping(ClassMapping base)
Description copied from interface: Result
If this is the result of a UNION used to select a hierarchy of mappings, the base mapping represented by the current row. This information is not available after getting any eager results from the row.

Specified by:
setBaseMapping in interface Result

getMappedByFieldMapping

public FieldMapping getMappedByFieldMapping()
Description copied from interface: Result
If this is the result used to select a toMany relationship, the mappedByFieldMapping is field mapping representing the inverse relationship. This is to avoid unneeded extra sql to retrieve the eager inverse field.

Specified by:
getMappedByFieldMapping in interface Result

setMappedByFieldMapping

public void setMappedByFieldMapping(FieldMapping fieldMapping)
Description copied from interface: Result
If this is the result used to select a toMany relationship, the mappedByFieldMapping is field mapping representing the inverse relationship. This is to avoid unneeded extra sql to retrieve the eager inverse field.

Specified by:
setMappedByFieldMapping in interface Result

getMappedByValue

public Object getMappedByValue()
Description copied from interface: Result
If this is the result used to select a toMany relationship, the mappedByValue is value of the owner of the toMany relationship. This is to avoid unneeded extra sql to retrieve the eager inverse field.

Specified by:
getMappedByValue in interface Result

setMappedByValue

public void setMappedByValue(Object mappedByValue)
Description copied from interface: Result
If this is the result used to select a toMany relationship, the mappedByValue is value of the owner of the toMany relationship. This is to avoid unneeded extra sql to retrieve the eager inverse field.

Specified by:
setMappedByValue in interface Result

indexOf

public int indexOf()
Description copied from interface: Result
The index of the select within the UNION that the current row corresponds to, or 0.

Specified by:
indexOf in interface Result

setIndexOf

public void setIndexOf(int idx)

load

public Object load(ClassMapping mapping,
                   JDBCStore store,
                   JDBCFetchConfiguration fetch)
            throws SQLException
Description copied from interface: Result
Load a pc object using the given store manager.

Specified by:
load in interface Result
Throws:
SQLException

load

public Object load(ClassMapping mapping,
                   JDBCStore store,
                   JDBCFetchConfiguration fetch,
                   Joins joins)
            throws SQLException
Description copied from interface: Result
Load a pc object using the given store manager.

Specified by:
load in interface Result
Throws:
SQLException

getArray

public Array getArray(Object obj)
               throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.

Specified by:
getArray in interface Result
Throws:
SQLException

getArray

public Array getArray(Column col,
                      Joins joins)
               throws SQLException
Description copied from interface: Result
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.

Specified by:
getArray in interface Result
Throws:
SQLException

getArrayInternal

protected Array getArrayInternal(Object obj,
                                 Joins joins)
                          throws SQLException
Throws:
SQLException

getAsciiStream

public InputStream getAsciiStream(Object obj)
                           throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.

Specified by:
getAsciiStream in interface Result
Throws:
SQLException

getAsciiStream

public InputStream getAsciiStream(Column col,
                                  Joins joins)
                           throws SQLException
Description copied from interface: Result
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.

Specified by:
getAsciiStream in interface Result
Throws:
SQLException

getAsciiStreamInternal

protected InputStream getAsciiStreamInternal(Object obj,
                                             Joins joins)
                                      throws SQLException
Throws:
SQLException

getBigDecimal

public BigDecimal getBigDecimal(Object obj)
                         throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getBigDecimal in interface Result
Throws:
SQLException

getBigDecimal

public BigDecimal getBigDecimal(Column col,
                                Joins joins)
                         throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getBigDecimal in interface Result
Throws:
SQLException

getBigDecimalInternal

protected BigDecimal getBigDecimalInternal(Object obj,
                                           Joins joins)
                                    throws SQLException
Throws:
SQLException

getBigInteger

public BigInteger getBigInteger(Object obj)
                         throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getBigInteger in interface Result
Throws:
SQLException

getBigInteger

public BigInteger getBigInteger(Column col,
                                Joins joins)
                         throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getBigInteger in interface Result
Throws:
SQLException

getBigIntegerInternal

protected BigInteger getBigIntegerInternal(Object obj,
                                           Joins joins)
                                    throws SQLException
Throws:
SQLException

getBinaryStream

public InputStream getBinaryStream(Object obj)
                            throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.

Specified by:
getBinaryStream in interface Result
Throws:
SQLException

getBinaryStream

public InputStream getBinaryStream(Column col,
                                   Joins joins)
                            throws SQLException
Description copied from interface: Result
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.

Specified by:
getBinaryStream in interface Result
Throws:
SQLException

getLOBStream

public InputStream getLOBStream(JDBCStore store,
                                Object obj)
                         throws SQLException
Specified by:
getLOBStream in interface Result
Throws:
SQLException

getBinaryStreamInternal

protected InputStream getBinaryStreamInternal(Object obj,
                                              Joins joins)
                                       throws SQLException
Throws:
SQLException

getLOBStreamInternal

protected InputStream getLOBStreamInternal(JDBCStore store,
                                           Object obj,
                                           Joins joins)
                                    throws SQLException
Throws:
SQLException

getBlob

public Blob getBlob(Object obj)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.

Specified by:
getBlob in interface Result
Throws:
SQLException

getBlob

public Blob getBlob(Column col,
                    Joins joins)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.

Specified by:
getBlob in interface Result
Throws:
SQLException

getBlobInternal

protected Blob getBlobInternal(Object obj,
                               Joins joins)
                        throws SQLException
Throws:
SQLException

getBoolean

public boolean getBoolean(Object obj)
                   throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getBoolean in interface Result
Throws:
SQLException

getBoolean

public boolean getBoolean(Column col,
                          Joins joins)
                   throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getBoolean in interface Result
Throws:
SQLException

getBooleanInternal

protected boolean getBooleanInternal(Object obj,
                                     Joins joins)
                              throws SQLException
Throws:
SQLException

getByte

public byte getByte(Object obj)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getByte in interface Result
Throws:
SQLException

getByte

public byte getByte(Column col,
                    Joins joins)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getByte in interface Result
Throws:
SQLException

getByteInternal

protected byte getByteInternal(Object obj,
                               Joins joins)
                        throws SQLException
Throws:
SQLException

getBytes

public byte[] getBytes(Object obj)
                throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.

Specified by:
getBytes in interface Result
Throws:
SQLException

getBytes

public byte[] getBytes(Column col,
                       Joins joins)
                throws SQLException
Description copied from interface: Result
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.

Specified by:
getBytes in interface Result
Throws:
SQLException

getBytesInternal

protected byte[] getBytesInternal(Object obj,
                                  Joins joins)
                           throws SQLException
Throws:
SQLException

getCalendar

public Calendar getCalendar(Object obj)
                     throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getCalendar in interface Result
Throws:
SQLException

getCalendar

public Calendar getCalendar(Column col,
                            Joins joins)
                     throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getCalendar in interface Result
Throws:
SQLException

getCalendarInternal

protected Calendar getCalendarInternal(Object obj,
                                       Joins joins)
                                throws SQLException
Throws:
SQLException

getChar

public char getChar(Object obj)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getChar in interface Result
Throws:
SQLException

getChar

public char getChar(Column col,
                    Joins joins)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getChar in interface Result
Throws:
SQLException

getCharInternal

protected char getCharInternal(Object obj,
                               Joins joins)
                        throws SQLException
Throws:
SQLException

getCharacterStream

public Reader getCharacterStream(Object obj)
                          throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.

Specified by:
getCharacterStream in interface Result
Throws:
SQLException

getCharacterStream

public Reader getCharacterStream(Column col,
                                 Joins joins)
                          throws SQLException
Description copied from interface: Result
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.

Specified by:
getCharacterStream in interface Result
Throws:
SQLException

getCharacterStreamInternal

protected Reader getCharacterStreamInternal(Object obj,
                                            Joins joins)
                                     throws SQLException
Throws:
SQLException

getClob

public Clob getClob(Object obj)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.

Specified by:
getClob in interface Result
Throws:
SQLException

getClob

public Clob getClob(Column col,
                    Joins joins)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.

Specified by:
getClob in interface Result
Throws:
SQLException

getClobInternal

protected Clob getClobInternal(Object obj,
                               Joins joins)
                        throws SQLException
Throws:
SQLException

getDate

public Date getDate(Object obj)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getDate in interface Result
Throws:
SQLException

getDate

public Date getDate(Column col,
                    Joins joins)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getDate in interface Result
Throws:
SQLException

getDateInternal

protected Date getDateInternal(Object obj,
                               Joins joins)
                        throws SQLException
Throws:
SQLException

getDate

public Date getDate(Object obj,
                    Calendar cal)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.

Specified by:
getDate in interface Result
Throws:
SQLException

getDate

public Date getDate(Column col,
                    Calendar cal,
                    Joins joins)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.

Specified by:
getDate in interface Result
Throws:
SQLException

getDateInternal

protected Date getDateInternal(Object obj,
                               Calendar cal,
                               Joins joins)
                        throws SQLException
Throws:
SQLException

getDouble

public double getDouble(Object obj)
                 throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getDouble in interface Result
Throws:
SQLException

getDouble

public double getDouble(Column col,
                        Joins joins)
                 throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getDouble in interface Result
Throws:
SQLException

getDoubleInternal

protected double getDoubleInternal(Object obj,
                                   Joins joins)
                            throws SQLException
Throws:
SQLException

getFloat

public float getFloat(Object obj)
               throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getFloat in interface Result
Throws:
SQLException

getFloat

public float getFloat(Column col,
                      Joins joins)
               throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getFloat in interface Result
Throws:
SQLException

getFloatInternal

protected float getFloatInternal(Object obj,
                                 Joins joins)
                          throws SQLException
Throws:
SQLException

getInt

public int getInt(Object obj)
           throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getInt in interface Result
Throws:
SQLException

getInt

public int getInt(Column col,
                  Joins joins)
           throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getInt in interface Result
Throws:
SQLException

getIntInternal

protected int getIntInternal(Object obj,
                             Joins joins)
                      throws SQLException
Throws:
SQLException

getLocale

public Locale getLocale(Object obj)
                 throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getLocale in interface Result
Throws:
SQLException

getLocale

public Locale getLocale(Column col,
                        Joins joins)
                 throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getLocale in interface Result
Throws:
SQLException

getLocaleInternal

protected Locale getLocaleInternal(Object obj,
                                   Joins joins)
                            throws SQLException
Throws:
SQLException

getLong

public long getLong(Object obj)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getLong in interface Result
Throws:
SQLException

getLong

public long getLong(Column col,
                    Joins joins)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getLong in interface Result
Throws:
SQLException

getLongInternal

protected long getLongInternal(Object obj,
                               Joins joins)
                        throws SQLException
Throws:
SQLException

getNumber

public Number getNumber(Object obj)
                 throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getNumber in interface Result
Throws:
SQLException

getNumber

public Number getNumber(Column col,
                        Joins joins)
                 throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getNumber in interface Result
Throws:
SQLException

getNumberInternal

protected Number getNumberInternal(Object obj,
                                   Joins joins)
                            throws SQLException
Throws:
SQLException

getObject

public Object getObject(Object obj,
                        int metaType,
                        Object arg)
                 throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getObject in interface Result
Parameters:
obj - the column or id whose data to fetch
metaType - the type code from JavaTypes or JavaSQLTypes for the type of the data; if obj is a column, you may specify -1 to use the column's recorded java type
arg - some JDBC data access methods use an argument, such as a Calendar or Map
Throws:
SQLException

getObject

public Object getObject(Column col,
                        Object arg,
                        Joins joins)
                 throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getObject in interface Result
Parameters:
col - the column whose data to fetch
arg - some JDBC data access methods use an argument, such as a Calendar or Map
Throws:
SQLException

getObjectInternal

protected abstract Object getObjectInternal(Object obj,
                                            int metaType,
                                            Object arg,
                                            Joins joins)
                                     throws SQLException
Return the value stored in the given id or column.

Throws:
SQLException

getStreamInternal

protected abstract Object getStreamInternal(JDBCStore store,
                                            Object obj,
                                            int metaType,
                                            Object arg,
                                            Joins joins)
                                     throws SQLException
Throws:
SQLException

getSQLObject

public Object getSQLObject(Object obj,
                           Map map)
                    throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.

Specified by:
getSQLObject in interface Result
Throws:
SQLException

getSQLObject

public Object getSQLObject(Column col,
                           Map map,
                           Joins joins)
                    throws SQLException
Description copied from interface: Result
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.

Specified by:
getSQLObject in interface Result
Throws:
SQLException

getSQLObjectInternal

protected Object getSQLObjectInternal(Object obj,
                                      Map map,
                                      Joins joins)
                               throws SQLException
Throws:
SQLException

getRef

public Ref getRef(Object obj,
                  Map map)
           throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.

Specified by:
getRef in interface Result
Throws:
SQLException

getRef

public Ref getRef(Column col,
                  Map map,
                  Joins joins)
           throws SQLException
Description copied from interface: Result
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.

Specified by:
getRef in interface Result
Throws:
SQLException

getRefInternal

protected Ref getRefInternal(Object obj,
                             Map map,
                             Joins joins)
                      throws SQLException
Throws:
SQLException

getShort

public short getShort(Object obj)
               throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getShort in interface Result
Throws:
SQLException

getShort

public short getShort(Column col,
                      Joins joins)
               throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getShort in interface Result
Throws:
SQLException

getShortInternal

protected short getShortInternal(Object obj,
                                 Joins joins)
                          throws SQLException
Throws:
SQLException

getString

public String getString(Object obj)
                 throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id.

Specified by:
getString in interface Result
Throws:
SQLException

getString

public String getString(Column col,
                        Joins joins)
                 throws SQLException
Description copied from interface: Result
Return the value stored in the given column.

Specified by:
getString in interface Result
Throws:
SQLException

getStringInternal

protected String getStringInternal(Object obj,
                                   Joins joins,
                                   boolean isClobString)
                            throws SQLException
Throws:
SQLException

getTime

public Time getTime(Object obj,
                    Calendar cal)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.

Specified by:
getTime in interface Result
Throws:
SQLException

getTime

public Time getTime(Column col,
                    Calendar cal,
                    Joins joins)
             throws SQLException
Description copied from interface: Result
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.

Specified by:
getTime in interface Result
Throws:
SQLException

getTimeInternal

protected Time getTimeInternal(Object obj,
                               Calendar cal,
                               Joins joins)
                        throws SQLException
Throws:
SQLException

getTimestamp

public Timestamp getTimestamp(Object obj,
                              Calendar cal)
                       throws SQLException
Description copied from interface: Result
Return the value stored in the given column or id; may not be supported by results that are not backed by a SQL result set.

Specified by:
getTimestamp in interface Result
Throws:
SQLException

getTimestamp

public Timestamp getTimestamp(Column col,
                              Calendar cal,
                              Joins joins)
                       throws SQLException
Description copied from interface: Result
Return the value stored in the given column; may not be supported by results that are not backed by a SQL result set.

Specified by:
getTimestamp in interface Result
Throws:
SQLException

getTimestampInternal

protected Timestamp getTimestampInternal(Object obj,
                                         Calendar cal,
                                         Joins joins)
                                  throws SQLException
Throws:
SQLException

wasNull

public boolean wasNull()
                throws SQLException
Description copied from interface: Result
Return true if the last value fetched was null.

Specified by:
wasNull in interface Result
Throws:
SQLException

checkNull

protected Object checkNull(Object val)

setLocking

public void setLocking(boolean locking)
Description copied from interface: Result
Set to true if row locking has been issued for the row.

Specified by:
setLocking in interface Result

isLocking

public boolean isLocking()
Description copied from interface: Result
If true, then any results loaded from this Result will be locked in the database.

Specified by:
isLocking in interface Result

startDataRequest

public void startDataRequest(Object mapping)
Description copied from interface: Result
Informs this receiver about the application element for which a subsequent data request will be made.

Specified by:
startDataRequest in interface Result

endDataRequest

public void endDataRequest()
Description copied from interface: Result
Ends a data request. Must be called in conjunction with Result.startDataRequest(java.lang.Object). The calls can be nested as follws
 startDataRequest (relation); startDataRequest (relationsField);
 getObject("COLUMN_Y"); endDataRequest (); endDataRequest ();
 

Specified by:
endDataRequest in interface Result

translate

protected Object translate(Object obj,
                           Joins joins)
                    throws SQLException
Translate the user-given id or column. This method is called before delegating to any get*Internal methods with the exception of getObjectInternal. Return the original value by default.

Throws:
SQLException


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.