| Constructor and Description |
|---|
IdBinderSimple(BeanProperty idProperty) |
| 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()
Returns 1.
|
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 is)
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 os,
Object value)
Write the Id value to binary DataOuput.
|
public IdBinderSimple(BeanProperty idProperty)
public void initialise()
IdBinderinitialise in interface IdBinderpublic String getOrderBy(String pathPrefix, boolean ascending)
getOrderBy in interface IdBinderpublic void buildSelectExpressionChain(String prefix, List<String> selectChain)
buildSelectExpressionChain in interface IdBinderpublic int getPropertyCount()
getPropertyCount in interface IdBinderpublic String getIdProperty()
IdBinderThis can be used to include in a query.
getIdProperty in interface IdBinderpublic BeanProperty findBeanProperty(String dbColumnName)
IdBinderfindBeanProperty in interface IdBinderpublic boolean isComplexId()
IdBinderisComplexId in interface IdBinderpublic String getDefaultOrderBy()
IdBindergetDefaultOrderBy in interface IdBinderpublic BeanProperty[] getProperties()
IdBindergetProperties in interface IdBinderpublic String getBindIdInSql(String baseTableAlias)
IdBindergetBindIdInSql in interface IdBinderpublic String getBindIdSql(String baseTableAlias)
IdBindergetBindIdSql in interface IdBinderpublic Object[] getIdValues(Object bean)
IdBindergetIdValues in interface IdBinderpublic Object[] getBindValues(Object idValue)
IdBinderFor 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.
getBindValues in interface IdBinderpublic String getIdInValueExprDelete(int size)
IdBindergetIdInValueExprDelete in interface IdBinderpublic String getIdInValueExpr(int size)
IdBindergetIdInValueExpr in interface IdBinderpublic void addIdInBindValue(SpiExpressionRequest request, Object value)
addIdInBindValue in interface IdBinderpublic void bindId(DefaultSqlUpdate sqlUpdate, Object value)
IdBinderpublic void bindId(DataBind dataBind, Object value) throws SQLException
IdBinderbindId in interface IdBinderSQLExceptionpublic void writeData(DataOutput os, Object value) throws IOException
IdBinderwriteData in interface IdBinderIOExceptionpublic Object readData(DataInput is) throws IOException
IdBinderreadData in interface IdBinderIOExceptionpublic void loadIgnore(DbReadContext ctx)
IdBinderloadIgnore in interface IdBinderpublic Object readSet(DbReadContext ctx, Object bean) throws SQLException
IdBinderreadSet in interface IdBinderSQLExceptionpublic Object read(DbReadContext ctx) throws SQLException
IdBinderread in interface IdBinderSQLExceptionpublic void appendSelect(DbSqlContext ctx, boolean subQuery)
IdBinderappendSelect in interface IdBinderpublic String getAssocOneIdExpr(String prefix, String operator)
IdBinderTypically used to build a id = ? string.
getAssocOneIdExpr in interface IdBinderpublic String getAssocIdInExpr(String prefix)
IdBindergetAssocIdInExpr in interface IdBinderpublic Object convertSetId(Object idValue, Object bean)
IdBinderThe 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.
convertSetId in interface IdBinderCopyright © 2014. All Rights Reserved.