org.apache.empire.db
Class DBRecordData

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

public abstract class DBRecordData
extends DBObject
implements RecordData

This interface defines for the classes DDRecordSet and DBRecord.

See Also:
Serialized Form

Constructor Summary
DBRecordData()
           
 
Method Summary
abstract  int addColumnDesc(Element parent)
           
abstract  int addRowValues(Element parent)
           
abstract  void close()
           
 int getBeanProperties(Object bean)
          Injects the current field values into a java bean.
 int getBeanProperties(Object bean, Collection<ColumnExpr> ignoreList)
          Injects the current field values into a java bean.
protected  void getBeanProperty(Object bean, String property, Object value)
          Set a single property value of a java bean object used by readProperties.
 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()
 Date getDateTime(ColumnExpr column)
          Returns a data value for the desired column.
 Date getDateTime(int index)
          Returns a data value identified by the column index.
 BigDecimal getDecimal(ColumnExpr column)
          Returns a data value for the desired column.
 BigDecimal getDecimal(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 performance for bulk processing
abstract  int getFieldIndex(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.
 String getString(ColumnExpr column)
          Returns a data value for the desired column.
 String getString(int index)
          Returns a data value identified by the column index.
 Object getValue(ColumnExpr column)
          Returns a data value for the desired column .
abstract  Object getValue(int index)
          Returns a value based on an index.
abstract  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 java.lang.Object
clone, equals, finalize, 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 performance 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(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 int addColumnDesc(Element parent)

addRowValues

public abstract int addRowValues(Element parent)

getXmlDocument

public abstract Document getXmlDocument()

close

public abstract void close()

getValue

public abstract 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 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 - identifying 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 - identifying 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 - identifying the column
Returns:
the value

getDecimal

public BigDecimal getDecimal(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

getDecimal

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

Parameters:
column - identifying 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 - identifying the column
Returns:
the value

getString

public 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 String getString(ColumnExpr column)
Returns a data value for the desired column. The data value is converted to a string if necessary.

Parameters:
column - identifying the column
Returns:
the value

getDateTime

public 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 Date getDateTime(ColumnExpr column)
Returns a data value for the desired column. The data value is converted to a Date if necessary.

Parameters:
column - identifying 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 - identifying the column
Returns:
true if the value is null or false otherwise

getBeanProperty

protected void getBeanProperty(Object bean,
                               String property,
                               Object value)
Set a single property value of a java bean object used by readProperties.


getBeanProperties

public int getBeanProperties(Object bean,
                             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:
the number of bean properties set on the supplied bean

getBeanProperties

public final int getBeanProperties(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:
the number of bean properties set on the supplied bean


Copyright © 2008–2014 Apache Software Foundation. All rights reserved.