java.lang.Object
io.github.mmm.orm.param.AbstractCriteriaParameters
io.github.mmm.orm.param.CriteriaParametersNamed
- All Implemented Interfaces:
io.github.mmm.property.criteria.CriteriaParameters<CriteriaParameterImpl<?>>,Iterable<CriteriaParameterImpl<?>>
CriteriaParameters using named parameters. It puts ":«name»" into the output and collects the
parameters that can get accessed via AbstractCriteriaParameters.iterator() after the database statement has been formatted and can be
bound as parameters to the statement.- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionCriteriaParametersNamed(AbstractDbDialect<?> dialect, boolean merge) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected <V> CriteriaParameterImpl<V> createParameter(int index, V value, DbType<V, ?> dbType, io.github.mmm.property.criteria.CriteriaExpression<?> parent) booleanisMerge()Methods inherited from class io.github.mmm.orm.param.AbstractCriteriaParameters
apply, iterator, onLiteralMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.mmm.property.criteria.CriteriaParameters
castMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CriteriaParametersNamed
The constructor.- Parameters:
dialect- theAbstractDbDialect.merge- themerge flag.
-
-
Method Details
-
isMerge
public boolean isMerge()- Returns:
trueif twoLiterals with same parameter name should be joined if theirvalues areequalto each other,falseotherwise. So if your SQL hasp.Property() = 42 AND q.Property() = 42a merge would create just one parameter ":property" with the value "42" and without merge it would add two parameters ":property" and ":property2" both with the value "42".
-
createParameter
protected <V> CriteriaParameterImpl<V> createParameter(int index, V value, DbType<V, ?> dbType, io.github.mmm.property.criteria.CriteriaExpression<?> parent) - Specified by:
createParameterin classAbstractCriteriaParameters- Type Parameters:
V- type of thevalue.- Parameters:
index- theindex.value- thevalue.dbType- the thedatabase type.parent- the parentCriteriaExpression(seeAbstractCriteriaParameters.onLiteral(Literal, AppendableWriter, CriteriaExpression)).- Returns:
- the new
CriteriaParameterImpl.
-
getParameters
- Returns:
- the
Mapof collected named parameter values to bind to the database statement.
-