public interface ValueAccessor
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOGGER |
| Modifier and Type | Method and Description |
|---|---|
default java.lang.Class<?> |
getClassForColumnClassName(java.lang.String className,
java.lang.Class<?> defaultClass)
Use column class name
|
java.lang.Class<?> |
getJavaType(BaseElement elem)
Provides the Java type to be used for JDBC columns and parameters in the Manifold SQL APIs.
|
int |
getJdbcType()
Indicates the JDBC type handled by this implementation.
|
default java.lang.String |
getParameterExpression(java.sql.DatabaseMetaData metaData,
java.lang.Object value,
ColumnInfo ci)
Supply a parameter expression.
|
java.lang.Object |
getRowValue(java.sql.ResultSet rs,
BaseElement elem)
Returns a query result value corresponding with an
elem from result set, rs. |
void |
setParameter(java.sql.PreparedStatement ps,
int pos,
java.lang.Object value)
Sets the query parameter value corresponding with
pos. |
int getJdbcType()
Types id this accessor handles. This type must be unique among other ValueAccessor
instances returned from ValueAccessorProvider.get(int).java.lang.Class<?> getJavaType(BaseElement elem)
elem - A schema column, query column, parameter, or other value bearing element.elem in the Manifold SQL APIs.java.lang.Object getRowValue(java.sql.ResultSet rs,
BaseElement elem)
throws java.sql.SQLException
elem from result set, rs.rs - The result set containing rows of column valueselem - The query column containing the valueelem. Note, the type of the value must match the Java type returned from
elem.getJdbcType().java.sql.SQLExceptionvoid setParameter(java.sql.PreparedStatement ps,
int pos,
java.lang.Object value)
throws java.sql.SQLException
pos.ps - The prepared statement containing the parameterized query.pos - The index of the parameter, beginning with 1.value - The value of the parameterjava.sql.SQLExceptiondefault java.lang.String getParameterExpression(java.sql.DatabaseMetaData metaData,
java.lang.Object value,
ColumnInfo ci)
?, however some JDBC drivers and database systems
require explicit casts when using certain data types. For instance, Postgres requires casts for several types e.g.,
Boolean to bit; there is no other way to get a value from Java into a Postgres bit column.default java.lang.Class<?> getClassForColumnClassName(java.lang.String className,
java.lang.Class<?> defaultClass)
Copyright © 2024. All rights reserved.