java.lang.Object
io.ebeaninternal.server.deploy.id.IdBinderEmbedded
- All Implemented Interfaces:
IdBinder
Bind an Id that is an Embedded bean.
-
Constructor Summary
ConstructorsConstructorDescriptionIdBinderEmbedded(boolean idInExpandedForm, BeanPropertyAssocOne<?> embIdProperty) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBindValues(SpiExpressionBind request, Collection<?> values) Binds multiple id value to a request.voidaddBindValues(DefaultSqlUpdate sqlUpdate, Collection<?> values) Binds multiple id value to an update.voidappendSelect(DbSqlContext ctx, boolean subQuery) Append to the select clause.Build a string of the logical expressions.assocInExpr(String prefix) Return the logical id in expression taking into account embedded id's.Return the Id BeanProperty.Return the sql for binding the id to.voidBinds an id value to a prepared statement.voidbindId(DefaultSqlUpdate sqlUpdate, Object value) Bind the id value to a SqlUpdate statement.Return the sql for binding the id using an IN clause.Object[]bindValues(Object value) Return the values as an array of scalar bindable values.voidbuildRawSqlSelectChain(String prefix, List<String> selectChain) Return a key to use for bean caches given the id value.cacheKeyFromBean(EntityBean bean) Return a key to use for bean caches given the bean.convertForJson(EntityBean bean) Convert from embedded bean to Map.convertFromJson(Object value) Convert back from a Map to embedded bean.Cast or convert the Id value if necessary.convertSetId(Object idValue, EntityBean bean) Cast or convert the Id value if necessary and optionally set it.findBeanProperty(String dbColumnName) Find a BeanProperty that is mapped to the database column.idInValueExpr(boolean not, int size) Return the binding expression (like "?" or "(?,?)")for the Id.idInValueExprDelete(int size) Same as getIdInValueExpr but for delete by id.idSelect()voidInitialise the binder.booleanReturn false if the id is a simple scalar and false if it is embedded or concatenated.booleanReturn true if this is a compound key and must use expanded and or form.voidloadIgnore(DbReadContext ctx) Ignore the appropriate number of scalar properties for this id.orderBy()Return the default order by that may need to be used if the query includes a many property.read(DbReadContext ctx) Read the id value from the result set and return it.Read the Id value from the binary DataInput.readSet(DbReadContext ctx, EntityBean bean) Read the id value from the result set and set it to the bean also returning it.intsize()Return the number of properties that make up the id.Object[]values(EntityBean bean) Return the id values for a given bean.voidwriteData(DataOutput dataOutput, Object idValue) Write the Id value to binary DataOuput.
-
Constructor Details
-
IdBinderEmbedded
-
-
Method Details
-
initialise
public void initialise()Description copied from interface:IdBinderInitialise the binder.- Specified by:
initialisein interfaceIdBinder
-
idSelect
-
isIdInExpandedForm
public boolean isIdInExpandedForm()Description copied from interface:IdBinderReturn true if this is a compound key and must use expanded and or form.- Specified by:
isIdInExpandedFormin interfaceIdBinder
-
beanProperty
Description copied from interface:IdBinderReturn the Id BeanProperty.- Specified by:
beanPropertyin interfaceIdBinder
-
descriptor
-
buildRawSqlSelectChain
- Specified by:
buildRawSqlSelectChainin interfaceIdBinder
-
findBeanProperty
Description copied from interface:IdBinderFind a BeanProperty that is mapped to the database column.- Specified by:
findBeanPropertyin interfaceIdBinder
-
isComplexId
public boolean isComplexId()Description copied from interface:IdBinderReturn false if the id is a simple scalar and false if it is embedded or concatenated.- Specified by:
isComplexIdin interfaceIdBinder
-
size
public int size()Description copied from interface:IdBinderReturn the number of properties that make up the id. -
orderBy
Description copied from interface:IdBinderReturn the default order by that may need to be used if the query includes a many property. -
orderBy
-
properties
-
idInValueExprDelete
Description copied from interface:IdBinderSame as getIdInValueExpr but for delete by id.- Specified by:
idInValueExprDeletein interfaceIdBinder
-
idInValueExpr
Description copied from interface:IdBinderReturn the binding expression (like "?" or "(?,?)")for the Id.- Specified by:
idInValueExprin interfaceIdBinder
-
values
Description copied from interface:IdBinderReturn the id values for a given bean. -
bindValues
Description copied from interface:IdBinderReturn the values as an array of scalar bindable values.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.
- Specified by:
bindValuesin interfaceIdBinder
-
convertForJson
Convert from embedded bean to Map.- Specified by:
convertForJsonin interfaceIdBinder
-
convertFromJson
Convert back from a Map to embedded bean.- Specified by:
convertFromJsonin interfaceIdBinder
-
bindId
Description copied from interface:IdBinderBind the id value to a SqlUpdate statement. -
bindId
public void bindId(io.ebeaninternal.server.bind.DataBind dataBind, Object value) throws SQLException Description copied from interface:IdBinderBinds an id value to a prepared statement.- Specified by:
bindIdin interfaceIdBinder- Throws:
SQLException
-
addBindValues
Description copied from interface:IdBinderBinds multiple id value to an update.- Specified by:
addBindValuesin interfaceIdBinder
-
addBindValues
Description copied from interface:IdBinderBinds multiple id value to a request.- Specified by:
addBindValuesin interfaceIdBinder
-
readData
Description copied from interface:IdBinderRead the Id value from the binary DataInput.- Specified by:
readDatain interfaceIdBinder- Throws:
IOException
-
writeData
Description copied from interface:IdBinderWrite the Id value to binary DataOuput.- Specified by:
writeDatain interfaceIdBinder- Throws:
IOException
-
loadIgnore
Description copied from interface:IdBinderIgnore the appropriate number of scalar properties for this id.- Specified by:
loadIgnorein interfaceIdBinder
-
read
Description copied from interface:IdBinderRead the id value from the result set and return it.- Specified by:
readin interfaceIdBinder- Throws:
SQLException
-
readSet
Description copied from interface:IdBinderRead the id value from the result set and set it to the bean also returning it.- Specified by:
readSetin interfaceIdBinder- Throws:
SQLException
-
appendSelect
Description copied from interface:IdBinderAppend to the select clause.- Specified by:
appendSelectin interfaceIdBinder
-
assocInExpr
Description copied from interface:IdBinderReturn the logical id in expression taking into account embedded id's.- Specified by:
assocInExprin interfaceIdBinder
-
assocExpr
Description copied from interface:IdBinderBuild a string of the logical expressions.Typically used to build a id = ? string.
-
bindEqSql
Description copied from interface:IdBinderReturn the sql for binding the id to. This includes table alias and columns that make up the id. -
bindInSql
Description copied from interface:IdBinderReturn the sql for binding the id using an IN clause. -
convertId
Description copied from interface:IdBinderCast or convert the Id value if necessary. -
convertSetId
Description copied from interface:IdBinderCast or convert the Id value if necessary and optionally set it.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.
- Specified by:
convertSetIdin interfaceIdBinder
-
cacheKey
Description copied from interface:IdBinderReturn a key to use for bean caches given the id value. -
cacheKeyFromBean
Description copied from interface:IdBinderReturn a key to use for bean caches given the bean.- Specified by:
cacheKeyFromBeanin interfaceIdBinder
-