public abstract class DBRecordData extends DBObject implements DBContextAware, RecordData
Constructor and Description |
---|
DBRecordData() |
Modifier and Type | Method and Description |
---|---|
abstract int |
addXmlData(Element parent) |
abstract int |
addXmlMeta(Element parent) |
protected String |
formatValue(ColumnExpr column,
Object value)
Convert a non-string value to a string
|
<T> T |
get(Column column,
Class<T> returnType)
Returns the value of a field as an object of a given (wrapper)type
|
Object |
get(ColumnExpr column)
Returns a data value for the desired column .
|
Object[] |
getArray(ColumnExpr... columns)
Returns an array of values for the given column expressions
|
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.
|
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.
|
<T extends Enum<?>> |
getEnum(Column column)
Returns the value of a field as an enum
This assumes that the column attribute "enumType" has been set to an enum type
|
<T extends Enum<?>> |
getEnum(ColumnExpr column,
Class<T> enumType)
Returns the value of a field as an enum
For numeric columns the value is assumed to be an ordinal of the enumeration item
For non numeric columns the value is assumed to be the name of the enumeration item
|
<T extends Enum<?>> |
getEnum(int index,
Class<T> enumType)
Returns the value of a field as an enum
For numeric columns the value is assumed to be an ordinal of the enumeration item
For non numeric columns the value is assumed to be the name of the enumeration item
|
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.
|
LocalDate |
getLocalDate(ColumnExpr column)
Returns a data value for the desired column.
|
LocalDate |
getLocalDate(int index)
Returns a data value identified by the column index.
|
LocalDateTime |
getLocalDateTime(ColumnExpr column)
Returns a data value for the desired column.
|
LocalDateTime |
getLocalDateTime(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.
|
String |
getText(ColumnExpr column)
Returns the value of a column as a formatted text
This converts the value to a string if necessary and performs an options lookup
To customize conversion please override convertToString()
|
<T> T |
getValue(Column column,
Class<T> returnType)
Deprecated.
|
Object |
getValue(ColumnExpr column)
Deprecated.
|
abstract Object |
getValue(int index)
Returns a value based on an index.
|
Object[] |
getValues(ColumnExpr... columns)
Deprecated.
|
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.
|
int |
setBeanProperties(Object bean)
Injects the current field values into a java bean.
|
int |
setBeanProperties(Object bean,
Collection<? extends ColumnExpr> ignoreList)
Injects the current field values into a java bean.
|
protected void |
setBeanProperty(ColumnExpr column,
Object bean,
String property,
Object value)
Set a single property value of a java bean object used by readProperties.
|
checkParamNull, getDatabase
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContext
getColumn
public abstract int getFieldCount()
RecordData
getFieldCount
in interface RecordData
public abstract int getFieldIndex(ColumnExpr column)
RecordData
getFieldIndex
in interface RecordData
column
- the column for which to return the indexpublic abstract int getFieldIndex(String column)
RecordData
getFieldIndex
in interface RecordData
column
- the name of the column for which to return the indexpublic abstract int addXmlMeta(Element parent)
public abstract int addXmlData(Element parent)
public abstract Document getXmlDocument()
public abstract Object getValue(int index)
getValue
in interface RecordData
index
- the field index for which to return the value@Deprecated public Object getValue(ColumnExpr column)
@Deprecated public final <T> T getValue(Column column, Class<T> returnType)
@Deprecated public final Object[] getValues(ColumnExpr... columns)
public final Object get(ColumnExpr column)
get
in interface RecordData
column
- the column for which to obtain the valuepublic final <T> T get(Column column, Class<T> returnType)
column
- the column for which to retrieve the valuereturnType
- the type of the returned valuepublic final Object[] getArray(ColumnExpr... columns)
columns
- the column expressionspublic int getInt(int index)
index
- index of the columnpublic final int getInt(ColumnExpr column)
column
- identifying the columnpublic long getLong(int index)
index
- index of the columnpublic final long getLong(ColumnExpr column)
column
- identifying the columnpublic double getDouble(int index)
index
- index of the columnpublic final double getDouble(ColumnExpr column)
column
- identifying the columnpublic BigDecimal getDecimal(int index)
index
- index of the columnpublic final BigDecimal getDecimal(ColumnExpr column)
column
- identifying the columnpublic boolean getBoolean(int index)
index
- index of the columnpublic final boolean getBoolean(ColumnExpr column)
column
- identifying the columnpublic String getString(int index)
index
- index of the columnpublic final String getString(ColumnExpr column)
column
- identifying the columnpublic final Date getDateTime(int index)
index
- index of the columnpublic final Date getDateTime(ColumnExpr column)
column
- identifying the columnpublic final LocalDate getLocalDate(int index)
index
- index of the columnpublic final LocalDate getLocalDate(ColumnExpr column)
column
- identifying the columnpublic final LocalDateTime getLocalDateTime(int index)
index
- index of the columnpublic final LocalDateTime getLocalDateTime(ColumnExpr column)
column
- identifying the columnpublic <T extends Enum<?>> T getEnum(int index, Class<T> enumType)
index
- index of the fieldpublic final <T extends Enum<?>> T getEnum(ColumnExpr column, Class<T> enumType)
column
- the column for which to retrieve the valuepublic final <T extends Enum<?>> T getEnum(Column column)
column
- the column for which to retrieve the valuepublic boolean isNull(int index)
isNull
in interface RecordData
index
- index of the columnpublic final boolean isNull(ColumnExpr column)
isNull
in interface RecordData
column
- identifying the columnpublic String getText(ColumnExpr column)
column
- the column for which to get the formatted valueprotected String formatValue(ColumnExpr column, Object value)
column
- the column expressionvalue
- the value to formatprotected void setBeanProperty(ColumnExpr column, Object bean, String property, Object value)
public int setBeanProperties(Object bean, Collection<? extends ColumnExpr> ignoreList)
setBeanProperties
in interface RecordData
bean
- the Java Bean for which to set the propertiesignoreList
- list of columns to skip (optional)public final int setBeanProperties(Object bean)
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.