org.apache.empire.db
Class DBRecordData

java.lang.Object
  extended by org.apache.empire.commons.ErrorObject
      extended by org.apache.empire.db.DBObject
          extended by org.apache.empire.db.DBRecordData
All Implemented Interfaces:
ErrorInfo, RecordData
Direct Known Subclasses:
DBReader, DBRecord

public abstract class DBRecordData
extends DBObject
implements RecordData

This interface defines for the classes DDRecordSet and DBRecord.


Constructor Summary
DBRecordData()
           
 
Method Summary
abstract  boolean addColumnDesc(org.w3c.dom.Element parent)
           
abstract  boolean addRowValues(org.w3c.dom.Element parent)
           
abstract  void close()
           
 boolean getBeanProperties(java.lang.Object bean)
          Injects the current field values into a java bean.
 boolean getBeanProperties(java.lang.Object bean, java.util.Collection<ColumnExpr> ignoreList)
          Injects the current field values into a java bean.
 boolean getBoolean(ColumnExpr column)
          Returns a data value for the desired column.
 boolean getBoolean(int index)
          Returns a data value identified by the column index.
abstract  ColumnExpr getColumnExpr(int i)
          returns the column expression for a given column This is the reverse operation of getFieldIndex()
 java.util.Date getDateTime(ColumnExpr column)
          Returns a data value for the desired column.
 java.util.Date getDateTime(int index)
          Returns a data value identified by the column index.
 double getDouble(ColumnExpr column)
          Returns a data value for the desired column.
 double getDouble(int index)
          Returns a data value identified by the column index.
abstract  int getFieldCount()
          returns the number of field available
abstract  int getFieldIndex(ColumnExpr column)
          returns the index of the given column expression Indexed operations provide better performace for bulk processing
abstract  int getFieldIndex(java.lang.String column)
          returns the index of the column expression with the given name
 int getInt(ColumnExpr column)
          Returns a data value for the desired column.
 int getInt(int index)
          Returns a data value identified by the column index.
 long getLong(ColumnExpr column)
          Returns a data value for the desired column.
 long getLong(int index)
          Returns a data value identified by the column index.
 java.lang.String getString(ColumnExpr column)
          Returns a data value for the desired column.
 java.lang.String getString(int index)
          Returns a data value identified by the column index.
 java.lang.Object getValue(ColumnExpr column)
          Returns a data value for the desired column .
abstract  java.lang.Object getValue(int index)
          Returns a value based on an index.
abstract  org.w3c.dom.Document getXmlDocument()
           
 boolean isNull(ColumnExpr column)
          Checks whether or not the value for the given column is null.
 boolean isNull(int index)
          Checks whether or not the value for the given column is null.
 
Methods inherited from class org.apache.empire.db.DBObject
getDatabase
 
Methods inherited from class org.apache.empire.commons.ErrorObject
clearError, getErrorMessage, getErrorParams, getErrorSource, getErrorType, getMessage, hasError, isExceptionsEnabled, setExceptionsEnabled
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBRecordData

public DBRecordData()
Method Detail

getFieldCount

public abstract int getFieldCount()
Description copied from interface: RecordData
returns the number of field available

Specified by:
getFieldCount in interface RecordData
Returns:
field count

getFieldIndex

public abstract int getFieldIndex(ColumnExpr column)
Description copied from interface: RecordData
returns the index of the given column expression Indexed operations provide better performace for bulk processing

Specified by:
getFieldIndex in interface RecordData
Parameters:
column - the column for which to return the index
Returns:
the field index of the given column

getFieldIndex

public abstract int getFieldIndex(java.lang.String column)
Description copied from interface: RecordData
returns the index of the column expression with the given name

Specified by:
getFieldIndex in interface RecordData
Parameters:
column - the name of the column for which to return the index
Returns:
the field index of the given column

getColumnExpr

public abstract ColumnExpr getColumnExpr(int i)
Description copied from interface: RecordData
returns the column expression for a given column This is the reverse operation of getFieldIndex()

Specified by:
getColumnExpr in interface RecordData
Parameters:
i - field index of the column expression
Returns:
the column expression object or null if the index is out of range

addColumnDesc

public abstract boolean addColumnDesc(org.w3c.dom.Element parent)

addRowValues

public abstract boolean addRowValues(org.w3c.dom.Element parent)

getXmlDocument

public abstract org.w3c.dom.Document getXmlDocument()

close

public abstract void close()

getValue

public abstract java.lang.Object getValue(int index)
Returns a value based on an index.

Specified by:
getValue in interface RecordData
Parameters:
index - the field index for which to return the value
Returns:
the record value for the given field

getValue

public final java.lang.Object getValue(ColumnExpr column)
Returns a data value for the desired column .

Specified by:
getValue in interface RecordData
Parameters:
column - the column for which to obtain the value
Returns:
the record value

getInt

public int getInt(int index)
Returns a data value identified by the column index. The value is converted to integer if necessary .

Parameters:
index - index of the column
Returns:
the record value

getInt

public final int getInt(ColumnExpr column)
Returns a data value for the desired column. The data value is converted to integer if necessary.

Parameters:
column - identifing the column
Returns:
the value

getLong

public long getLong(int index)
Returns a data value identified by the column index. The data value is converted to a long if necessary.

Parameters:
index - index of the column
Returns:
the value

getLong

public final long getLong(ColumnExpr column)
Returns a data value for the desired column. The data value is converted to a long if necessary.

Parameters:
column - identifing the column
Returns:
the value

getDouble

public double getDouble(int index)
Returns a data value identified by the column index. The data value is converted to double if necessary.

Parameters:
index - index of the column
Returns:
the value

getDouble

public final double getDouble(ColumnExpr column)
Returns a data value for the desired column. The data value is converted to double if necessary.

Parameters:
column - identifing the column
Returns:
the value

getBoolean

public boolean getBoolean(int index)
Returns a data value identified by the column index. The data value is converted to boolean if necessary.

Parameters:
index - index of the column
Returns:
the value

getBoolean

public final boolean getBoolean(ColumnExpr column)
Returns a data value for the desired column. The data value is converted to boolean if necessary.

Parameters:
column - identifing the column
Returns:
the value

getString

public java.lang.String getString(int index)
Returns a data value identified by the column index. The data value is converted to a string if necessary.

Parameters:
index - index of the column
Returns:
the value

getString

public final java.lang.String getString(ColumnExpr column)
Returns a data value for the desired column. The data value is converted to a string if necessary.

Parameters:
column - identifing the column
Returns:
the value

getDateTime

public java.util.Date getDateTime(int index)
Returns a data value identified by the column index. The data value is converted to a Date if necessary.

Parameters:
index - index of the column
Returns:
the value

getDateTime

public final java.util.Date getDateTime(ColumnExpr column)
Returns a data value for the desired column. The data value is converted to a Date if necessary.

Parameters:
column - identifing the column
Returns:
the value

isNull

public boolean isNull(int index)
Checks whether or not the value for the given column is null.

Specified by:
isNull in interface RecordData
Parameters:
index - index of the column
Returns:
true if the value is null or false otherwise

isNull

public final boolean isNull(ColumnExpr column)
Checks whether or not the value for the given column is null.

Specified by:
isNull in interface RecordData
Parameters:
column - identifing the column
Returns:
true if the value is null or false otherwise

getBeanProperties

public boolean getBeanProperties(java.lang.Object bean,
                                 java.util.Collection<ColumnExpr> ignoreList)
Injects the current field values into a java bean.

Specified by:
getBeanProperties in interface RecordData
Parameters:
bean - the Java Bean for which to set the properties
ignoreList - list of columns to skip (optional)
Returns:
true if successful

getBeanProperties

public final boolean getBeanProperties(java.lang.Object bean)
Injects the current field values into a java bean.

Specified by:
getBeanProperties in interface RecordData
Parameters:
bean - the Java Bean for which to set the properties
Returns:
true if successful