Package org.mybatis.dynamic.sql
Class BoundValue<T>
java.lang.Object
org.mybatis.dynamic.sql.BoundValue<T>
- Type Parameters:
T- the column type
- All Implemented Interfaces:
BasicColumn,BindableColumn<T>
BoundValues are added to rendered SQL as a parameter marker only.
BoundValues are most useful in the context of functions. For example, a column value could be
incremented with an update statement like this:
UpdateStatementProvider updateStatement = update(person)
.set(age).equalTo(add(age, value(1)))
.where(id, isEqualTo(5))
.build()
.render(RenderingStrategies.MYBATIS3);
- Since:
- 1.5.1
-
Method Summary
Modifier and TypeMethodDescriptionalias()Returns the columns alias if one has been specified.Override the base method definition to make it more specific to this interface.static <T> BoundValue<T> of(T value) render(RenderingContext renderingContext) Returns a rendering of the column.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.mybatis.dynamic.sql.BasicColumn
jdbcType, renderingStrategy, typeHandlerMethods inherited from interface org.mybatis.dynamic.sql.BindableColumn
convertParameterType, javaType
-
Method Details
-
render
Description copied from interface:BasicColumnReturns a rendering of the column. The rendered fragment should include the table alias based on the TableAliasCalculator in the RenderingContext. The fragment could contain prepared statement parameter markers and associated parameter values if desired.- Specified by:
renderin interfaceBasicColumn- Parameters:
renderingContext- the rendering context (strategy, sequence, etc.)- Returns:
- a rendered SQL fragment and, optionally, parameters associated with the fragment
-
alias
Description copied from interface:BasicColumnReturns the columns alias if one has been specified.- Specified by:
aliasin interfaceBasicColumn- Returns:
- the column alias
-
as
Description copied from interface:BindableColumnOverride the base method definition to make it more specific to this interface.- Specified by:
asin interfaceBasicColumn- Specified by:
asin interfaceBindableColumn<T>- Parameters:
alias- the column alias to set- Returns:
- new instance with alias set
-
of
-