Package org.fryske_akademy.jpa
Class Param
- java.lang.Object
-
- org.fryske_akademy.jpa.Param
-
public class Param extends Object
Holder for parameter info used whenbuildinga jpql query. ABuilder()(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:
OPERATOR
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParam.AndOrstatic classParam.BuilderA 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Param.AndOrgetAndOr()Will be prepended in the query for parameters except the firstintgetGroupEnds()how many groups does this parameter end, ")";intgetGroupStarts()how many groups does this parameter start, "(";ObjectgetMaxValue()StringgetNot()OPERATORgetOperator()StringgetParamKey()for native queries this key should be a numeric positional parameterClassgetParamType()ObjectgetParamValue()StringgetPropertyPath()inthashCode()booleanisCaseInsensitive()static List<Param>one(String key, Object value)static List<Param>one(String key, String value, com.vectorprint.StringConverter converter)static List<Param>one(String propertyPath, String key, Object value)static List<Param>one(String propertyPath, String key, Object value, boolean syntaxSupport, Param.Builder.WildcardMapping wildcardMapping, boolean caseInsensitive)static List<Param>one(String key, OPERATOR operator, Object value)CallsParam.Builder.add(String, String, OPERATOR, Object, boolean, boolean, Object)with key,key,operator,value,false,false,nullvoidsetGroupEnds(int groupEnds)voidsetGroupStarts(int groupStarts)StringtoString()
-
-
-
Method Detail
-
one
public static List<Param> one(String key, Object value)
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
public static List<Param> one(String key, OPERATOR operator, Object value)
CallsParam.Builder.add(String, String, OPERATOR, Object, boolean, boolean, Object)with key,key,operator,value,false,false,null- Parameters:
key-operator-value-- Returns:
-
one
public static List<Param> one(String propertyPath, String key, Object value)
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
public static List<Param> one(String key, String value, com.vectorprint.StringConverter converter)
- 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
public String getPropertyPath()
-
getParamKey
public String getParamKey()
for native queries this key should be a numeric positional parameter- Returns:
-
getOperator
public OPERATOR getOperator()
-
getParamValue
public Object getParamValue()
-
getNot
public String getNot()
-
getAndOr
public Param.AndOr getAndOr()
Will be prepended in the query for parameters except the first- Returns:
-
getParamType
public Class getParamType()
-
getMaxValue
public Object 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)
-
-