java.lang.Object
io.github.mmm.property.criteria.CriteriaParametersNamed
- All Implemented Interfaces:
CriteriaParameters
CriteriaParameters
using named parameters. It puts ":«name»
" into the output and collects the
parameters in a Map
that can get accessed via getParameters()
after the database statement has been
formatted and can be bound as parameters to the statement.- Since:
- 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isMerge()
void
onLiteral
(Literal<?> literal, io.github.mmm.base.io.AppendableWriter out, CriteriaExpression<?> parent) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.mmm.property.criteria.CriteriaParameters
cast
-
Constructor Details
-
CriteriaParametersNamed
public CriteriaParametersNamed(boolean merge) The constructor.- Parameters:
merge
- themerge flag
.
-
-
Method Details
-
isMerge
public boolean isMerge()- Returns:
true
if twoLiteral
s with same parameter name should be joined if theirvalue
s areequal
to each other,false
otherwise. So if your SQL hasp.Property() = 42 AND q.Property() = 42
a 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".
-
onLiteral
public void onLiteral(Literal<?> literal, io.github.mmm.base.io.AppendableWriter out, CriteriaExpression<?> parent) - Specified by:
onLiteral
in interfaceCriteriaParameters
- Parameters:
literal
- theLiteral
towrite
in database syntax (e.g. SQL) and to collect as parameter.out
- theAppendableWriter
where towrite
theLiteral
in database syntax to.parent
- the parentCriteriaExpression
containing theLiteral
.
-
getParameters
- Returns:
- the
Map
of collected named parameter values to bind to the database statement.
-