public interface IdBinder
| Modifier and Type | Method and Description |
|---|---|
void |
addIdInBindValue(SpiExpressionRequest request,
Object value) |
void |
appendSelect(DbSqlContext ctx,
boolean subQuery)
Append to the select clause.
|
void |
bindId(DataBind dataBind,
Object value)
Binds an id value to a prepared statement.
|
void |
bindId(DefaultSqlUpdate sqlUpdate,
Object value)
Bind the id value to a SqlUpdate statement.
|
void |
buildSelectExpressionChain(String prefix,
List<String> selectChain) |
Object |
convertSetId(Object idValue,
Object bean)
Cast or convert the Id value if necessary and optionally set it.
|
BeanProperty |
findBeanProperty(String dbColumnName)
Find a BeanProperty that is mapped to the database column.
|
String |
getAssocIdInExpr(String prefix)
Return the logical id in expression taking into account embedded id's.
|
String |
getAssocOneIdExpr(String prefix,
String operator)
Build a string of the logical expressions.
|
String |
getBindIdInSql(String baseTableAlias)
Return the sql for binding the id using an IN clause.
|
String |
getBindIdSql(String baseTableAlias)
Return the sql for binding the id to.
|
Object[] |
getBindValues(Object idValue)
Return the values as an array of scalar bindable values.
|
String |
getDefaultOrderBy()
Return the default order by that may need to be used if the query includes
a many property.
|
String |
getIdInValueExpr(int size)
Return the binding expression (like "?" or "(?,?)")for the Id.
|
String |
getIdInValueExprDelete(int size)
Same as getIdInValueExpr but for delete by id.
|
String |
getIdProperty()
Return the name(s) of the Id property(s).
|
Object[] |
getIdValues(Object bean)
Return the id values for a given bean.
|
String |
getOrderBy(String pathPrefix,
boolean ascending) |
BeanProperty[] |
getProperties()
Return the id properties in flat form.
|
int |
getPropertyCount()
Return the number of scalar properties for this id.
|
void |
initialise()
Initialise the binder.
|
boolean |
isComplexId()
Return false if the id is a simple scalar and false if it is embedded or
concatenated.
|
void |
loadIgnore(DbReadContext ctx)
Ignore the appropriate number of scalar properties for this id.
|
Object |
read(DbReadContext ctx)
Read the id value from the result set and return it.
|
Object |
readData(DataInput dataInput)
Read the Id value from the binary DataInput.
|
Object |
readSet(DbReadContext ctx,
Object bean)
Read the id value from the result set and set it to the bean also returning
it.
|
void |
writeData(DataOutput dataOutput,
Object idValue)
Write the Id value to binary DataOuput.
|
void initialise()
void writeData(DataOutput dataOutput, Object idValue) throws IOException
IOExceptionObject readData(DataInput dataInput) throws IOException
IOExceptionString getIdProperty()
This can be used to include in a query.
BeanProperty findBeanProperty(String dbColumnName)
int getPropertyCount()
boolean isComplexId()
String getDefaultOrderBy()
Object[] getBindValues(Object idValue)
For concatenated keys that use an Embedded bean or multiple id properties this determines the field values are returns them as an Object array.
Added primarily for Query.addWhere().add(Expr.idEq()) support.
String getAssocOneIdExpr(String prefix, String operator)
Typically used to build a id = ? string.
String getAssocIdInExpr(String prefix)
void bindId(DataBind dataBind, Object value) throws SQLException
SQLExceptionvoid bindId(DefaultSqlUpdate sqlUpdate, Object value)
void addIdInBindValue(SpiExpressionRequest request, Object value)
String getBindIdInSql(String baseTableAlias)
String getIdInValueExpr(int size)
String getIdInValueExprDelete(int size)
Object readSet(DbReadContext ctx, Object bean) throws SQLException
SQLExceptionvoid loadIgnore(DbReadContext ctx)
Object read(DbReadContext ctx) throws SQLException
SQLExceptionvoid appendSelect(DbSqlContext ctx, boolean subQuery)
String getBindIdSql(String baseTableAlias)
BeanProperty[] getProperties()
Object convertSetId(Object idValue, Object bean)
The Id value is not assumed to be the correct type so it is converted to the correct type. Typically this is because we could get a Integer, Long or BigDecimal depending on the JDBC driver and situation.
If the bean is not null, then the value is set to the bean.
Copyright © 2014. All Rights Reserved.