Package org.fryske_akademy.jpa
Class Param
java.lang.Object
org.fryske_akademy.jpa.Param
Holder for parameter info used when
building a jpql
query. A Builder() (with syntax support by default) is
responsible for yielding parameters. Intelligence is in the Builder, not in
the Param. NOTE you can set logging level to DEBUG for trouble shooting.- Author:
- eduard
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classA factory for Param objects, parameter values can be added in two ways: as (the correct) Object => only syntax and wildcard support for String values as a String optionally using a converter => syntax support also for non String values, no wildcard support when converter is used -
Method Summary
Modifier and TypeMethodDescriptionbooleangetAndOr()Will be prepended in the query for parameters except the firstinthow many groups does this parameter end, ")";inthow many groups does this parameter start, "(";getNot()for native queries this key should be a numeric positional parameterinthashCode()booleanone(String propertyPath, String key, Object value, boolean syntaxSupport, Param.Builder.WildcardMapping wildcardMapping, boolean caseInsensitive) CallsParam.Builder.add(String, String, OPERATOR, Object, boolean, boolean, Object)with key,key,operator,value,false,false,nullvoidsetGroupEnds(int groupEnds) voidsetGroupStarts(int groupStarts) toString()
-
Method Details
-
one
Callone(java.lang.String, java.lang.String, java.lang.Object, boolean, org.fryske_akademy.jpa.Param.Builder.WildcardMapping, boolean)with true,Param.Builder.DEFAULT_MAPPINGand false- Parameters:
key-value-- Returns:
-
one
CallsParam.Builder.add(String, String, OPERATOR, Object, boolean, boolean, Object)with key,key,operator,value,false,false,null- Parameters:
key-operator-value-- Returns:
-
one
Callone(java.lang.String, java.lang.String, java.lang.Object, boolean, org.fryske_akademy.jpa.Param.Builder.WildcardMapping, boolean)with true,Param.Builder.DEFAULT_MAPPINGand false- Parameters:
propertyPath- The propertyPath may differ from key allowing you to apply multiple comparisons for the same propertyPath (i.e. e.column1=:column1 or e.column1=:column2).key-value-- Returns:
-
one
- Parameters:
key-value-converter-- Returns:
-
one
public static List<Param> one(String propertyPath, String key, Object value, boolean syntaxSupport, Param.Builder.WildcardMapping wildcardMapping, boolean caseInsensitive) - Parameters:
propertyPath- The propertyPath may differ from key allowing you to apply multiple comparisons for the same propertyPath (i.e. e.column1=:column1 or e.column1=:column2).key-value-syntaxSupport-wildcardMapping-caseInsensitive-- Returns:
-
getPropertyPath
-
getParamKey
for native queries this key should be a numeric positional parameter- Returns:
-
getOperator
-
getParamValue
-
getNot
-
getAndOr
Will be prepended in the query for parameters except the first- Returns:
-
getParamType
-
getMaxValue
-
isCaseInsensitive
public boolean isCaseInsensitive() -
getGroupStarts
public int getGroupStarts()how many groups does this parameter start, "(";- Returns:
-
getGroupEnds
public int getGroupEnds()how many groups does this parameter end, ")";- Returns:
-
setGroupStarts
public void setGroupStarts(int groupStarts) -
setGroupEnds
public void setGroupEnds(int groupEnds) -
toString
-
hashCode
public int hashCode() -
equals
-