Class NewNumberParmBehaviorUtil
- java.lang.Object
-
- com.ibm.fhir.persistence.jdbc.util.type.NewNumberParmBehaviorUtil
-
public class NewNumberParmBehaviorUtil extends Object
Number Parameter Behavior Util encapsulates the logic specific to Prefix treatment of the Search queries related to numbers, and the implied ranges therein. New implementation based onSelectinstead ofStringBuilder
-
-
Field Summary
Fields Modifier and Type Field Description protected static BigDecimalFACTOR
-
Constructor Summary
Constructors Constructor Description NewNumberParmBehaviorUtil()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddValue(com.ibm.fhir.database.utils.query.WhereFragment whereClauseSegment, String tableAlias, String columnBase, com.ibm.fhir.search.SearchConstants.Prefix prefix, BigDecimal value)Append the condition and bind the variables according to the semantics of the passed prefix adds the value to the whereClause.static voidbuildApproxRangeClause(com.ibm.fhir.database.utils.query.WhereFragment whereClauseSegment, String tableAlias, String columnBase, BigDecimal lowerBound, BigDecimal upperBound, BigDecimal value)Add the approx range clause to the given whereClauseSegmentstatic voidbuildCommonClause(com.ibm.fhir.database.utils.query.WhereFragment whereClauseSegment, String tableAlias, String columnName, String columnNameLow, String columnNameHigh, String operator, BigDecimal value, BigDecimal bound)the build common clause considers _VALUE_*** and _VALUE when querying the data.static voidbuildEbOrSaClause(com.ibm.fhir.database.utils.query.WhereFragment whereClauseSegment, String tableAlias, String columnNameLowOrHigh, String operator, BigDecimal bound)the build eb or sa clause considers only _VALUE_LOW and _VALUE_HIGHstatic voidbuildEqualsRangeClause(com.ibm.fhir.database.utils.query.WhereFragment whereClauseSegment, String tableAlias, String columnBase, BigDecimal lowerBound, BigDecimal upperBound)Add the equals range clause to the given whereClauseSegmentstatic voidbuildNotEqualsRangeClause(com.ibm.fhir.database.utils.query.WhereFragment whereClauseSegment, String tableAlias, String columnBase, BigDecimal lowerBound, BigDecimal upperBound)Add the not-equals range clause to the given whereClauseSegmentvoidexecuteBehavior(com.ibm.fhir.database.utils.query.WhereFragment whereClauseSegment, com.ibm.fhir.search.parameters.QueryParameter queryParm, String tableAlias)Add the filter predicate logic to the given whereClauseSegmentstatic BigDecimalgenerateLowerBound(BigDecimal original)Generate the lower bound for the given valuestatic BigDecimalgenerateUpperBound(BigDecimal original)Generate the upper bound for the given value
-
-
-
Field Detail
-
FACTOR
protected static final BigDecimal FACTOR
-
-
Method Detail
-
executeBehavior
public void executeBehavior(com.ibm.fhir.database.utils.query.WhereFragment whereClauseSegment, com.ibm.fhir.search.parameters.QueryParameter queryParm, String tableAlias) throws com.ibm.fhir.persistence.exception.FHIRPersistenceExceptionAdd the filter predicate logic to the given whereClauseSegment- Parameters:
whereClauseSegment-queryParm-tableAlias-- Throws:
com.ibm.fhir.persistence.exception.FHIRPersistenceException
-
addValue
public static void addValue(com.ibm.fhir.database.utils.query.WhereFragment whereClauseSegment, String tableAlias, String columnBase, com.ibm.fhir.search.SearchConstants.Prefix prefix, BigDecimal value)Append the condition and bind the variables according to the semantics of the passed prefix adds the value to the whereClause.- Parameters:
whereClauseSegment-tableAlias-columnBase-prefix-value-
-
buildCommonClause
public static void buildCommonClause(com.ibm.fhir.database.utils.query.WhereFragment whereClauseSegment, String tableAlias, String columnName, String columnNameLow, String columnNameHigh, String operator, BigDecimal value, BigDecimal bound)the build common clause considers _VALUE_*** and _VALUE when querying the data.
The data should not result in a duplication as the OR condition short circuits double matches. If one exists, great, we'll return it, else we'll peek at the other column.- Parameters:
whereClauseSegment-tableAlias-columnName-columnNameLow-columnNameHigh-operator-value-bound-
-
buildEbOrSaClause
public static void buildEbOrSaClause(com.ibm.fhir.database.utils.query.WhereFragment whereClauseSegment, String tableAlias, String columnNameLowOrHigh, String operator, BigDecimal bound)the build eb or sa clause considers only _VALUE_LOW and _VALUE_HIGH- Parameters:
whereClauseSegment-tableAlias-columnNameLowOrHigh-operator-bound-
-
buildEqualsRangeClause
public static void buildEqualsRangeClause(com.ibm.fhir.database.utils.query.WhereFragment whereClauseSegment, String tableAlias, String columnBase, BigDecimal lowerBound, BigDecimal upperBound)Add the equals range clause to the given whereClauseSegment- Parameters:
whereClauseSegment-tableAlias-columnBase-lowerBound-upperBound-
-
buildApproxRangeClause
public static void buildApproxRangeClause(com.ibm.fhir.database.utils.query.WhereFragment whereClauseSegment, String tableAlias, String columnBase, BigDecimal lowerBound, BigDecimal upperBound, BigDecimal value)Add the approx range clause to the given whereClauseSegment- Parameters:
whereClauseSegment-tableAlias-columnBase-lowerBound-upperBound-value-
-
buildNotEqualsRangeClause
public static void buildNotEqualsRangeClause(com.ibm.fhir.database.utils.query.WhereFragment whereClauseSegment, String tableAlias, String columnBase, BigDecimal lowerBound, BigDecimal upperBound)Add the not-equals range clause to the given whereClauseSegment- Parameters:
whereClauseSegment-tableAlias-columnBase-lowerBound-upperBound-
-
generateLowerBound
public static BigDecimal generateLowerBound(BigDecimal original)
Generate the lower bound for the given value- Parameters:
original-- Returns:
-
generateUpperBound
public static BigDecimal generateUpperBound(BigDecimal original)
Generate the upper bound for the given value- Parameters:
original-- Returns:
-
-