public class WhereConditionForPrepStmts extends WhereConditionStd
for more complex filtering
WhereConditionStd.AppendVariant
AND, EQUALS, GREATER, GREATER_EQUALS, IS_NOT_NULL, LIKE, LOWER, LOWER_EQUALS, NOT_EQUALS, OR, sqlDialect
Constructor and Description |
---|
WhereConditionForPrepStmts(AbstractTextAttribute a,
java.lang.String columnValue)
Constructs a new where condition for prepared statements and append a condition fragment.
|
WhereConditionForPrepStmts(CharAttribute a,
Identifier identifier)
Constructs a new where condition for prepared statements and append a condition fragment.
|
WhereConditionForPrepStmts(DataObject dataObject)
Constructs a new where condition.
|
WhereConditionForPrepStmts(NumericAttribute a,
Identifier identifier)
Constructs a new where condition for prepared statements and append a condition fragment.
|
WhereConditionForPrepStmts(NumericAttribute a,
int columnValue)
Constructs a new where condition for prepared statements and append a condition fragment.
|
WhereConditionForPrepStmts(java.lang.String columnName,
java.lang.String columnValue)
Constructs a new where condition for prepared statements and append a condition fragment.
|
Modifier and Type | Method and Description |
---|---|
void |
append(AbstractTextAttribute a,
java.lang.String columnValue)
Appends a value selection fragment to the where condition.
|
void |
append(AbstractTextAttribute a,
java.lang.String relation,
java.lang.String columnValue)
Appends a value selection fragment to the where condition.
|
void |
append(BooleanAttribute a,
boolean columnValue)
Appends a value selection fragment to the where condition.
|
void |
append(NumericAttribute a,
int columnValue)
Appends a value selection fragment to the where condition.
|
void |
append(NumericAttribute a,
java.lang.String relation,
int columnValue)
Appends a value selection fragment to the where condition.
|
void |
append(java.lang.String conditionFragement)
Appends a fragment to the where condition if not null and not an empty string.
|
void |
append(java.lang.String columnName,
boolean columnValue)
Appends a value selection fragment to the where condition.
|
protected void |
append(java.lang.StringBuilder queryExpression)
Appends the where condition to a query expression using the specified elements of this where condition.
|
void |
append(java.lang.String columnName,
java.sql.Date dateToCompare)
Appends a date selection fragment to the where condition which seems to work only for date values !
|
void |
append(java.lang.String columnName,
double columnValue)
Appends a value selection fragment to the where condition.
|
void |
append(java.lang.String columnName,
int columnValue)
Appends a value selection fragment to the where condition.
|
void |
append(java.lang.String columnName,
java.lang.String columnValue)
Appends a value selection fragment to the where condition.
|
void |
append(java.lang.String columnName,
java.lang.String relation,
java.sql.Date dateToCompare)
Appends a date selection fragment to the where condition.
|
void |
append(java.lang.String columnName,
java.lang.String relation,
int columnValue)
Appends a value selection fragment to the where condition.
|
void |
append(VarcharAttribute a,
java.lang.String columnValue)
Appends a value selection fragment to the where condition.
|
void |
appendLowerEqual(DateAttribute dateAttribute,
java.sql.Date dateToCompare,
DataObject dataObject)
Appends a date lower equals condition fragment to the where condition if not null.
|
void |
appendLowerEqual(java.lang.String columnName,
java.sql.Date dateToCompare,
DataObject dataObject)
Appends a date lower equals condition fragment to the where condition if not null.
|
protected void |
fill(java.sql.PreparedStatement stmt)
Fill the specified prepared statement with the values of this where condition.
|
int |
size()
Returns the number of elements of this where condition.
|
java.lang.String |
toString() |
getColumnNameWoTablePrefix, getColumnType, getDayBeginDate, getDayEndingDate, getDefaultRelation, getNextDayBeginDate, isToCast, isToCast, isToUseUpperCase, isToUseUpperCase
public WhereConditionForPrepStmts(DataObject dataObject)
dataObject
- the DataObject class to refer to the SQL dialect to comply topublic WhereConditionForPrepStmts(NumericAttribute a, Identifier identifier)
a
- the attribute containing name of the column to be usedidentifier
- the identifier to be selectedpublic WhereConditionForPrepStmts(CharAttribute a, Identifier identifier)
a
- the attribute containing name of the column to be usedidentifier
- the identifier to be selectedpublic WhereConditionForPrepStmts(NumericAttribute a, int columnValue)
a
- the attribute containing name of the column to be usedcolumnValue
- the column value to be selectedpublic WhereConditionForPrepStmts(AbstractTextAttribute a, java.lang.String columnValue)
a
- the attribute containing name of the column to be usedcolumnValue
- the column value to be selectedpublic WhereConditionForPrepStmts(java.lang.String columnName, java.lang.String columnValue)
columnName
- the name of the column to be usedcolumnValue
- the column value to be selectedpublic void append(NumericAttribute a, int columnValue)
a
- the attribute containing the column namecolumnValue
- the column value to be selectedpublic void append(java.lang.String columnName, int columnValue)
columnName
- the name of the column to be usedcolumnValue
- the column value to be selectedpublic void append(java.lang.String columnName, java.lang.String relation, int columnValue)
columnName
- the name of the column to be usedrelation
- the relation to be used (e.g. <, >)columnValue
- the column value to be selectedpublic void append(NumericAttribute a, java.lang.String relation, int columnValue)
a
- the attribute containing the column namerelation
- the relation to be used (e.g. =, <>)columnValue
- the numeric column value to selectpublic void append(java.lang.String columnName, double columnValue)
columnName
- the name of the column to be usedcolumnValue
- the column value to be selectedpublic void append(AbstractTextAttribute a, java.lang.String columnValue)
a
- the attribute containing the column namecolumnValue
- the column value to be selectedpublic void append(AbstractTextAttribute a, java.lang.String relation, java.lang.String columnValue)
a
- the attribute containing the column namerelation
- the relation to be used (e.g. =, LIKE)columnValue
- the column value to be selectedpublic void append(VarcharAttribute a, java.lang.String columnValue)
a
- the attribute containing the column namecolumnValue
- the column value to be selectedpublic void append(java.lang.String columnName, java.lang.String columnValue)
columnName
- the name of the column to be used (only char and varchar, no memos, yet!)columnValue
- the column value to be selectedpublic void append(BooleanAttribute a, boolean columnValue)
a
- the attribute containing the column namecolumnValue
- the column value to be selectedpublic void append(java.lang.String columnName, boolean columnValue)
columnName
- the name of the column to be usedcolumnValue
- the column value to be selectedpublic void append(java.lang.String columnName, java.sql.Date dateToCompare)
columnName
- the column name to be used for the date comparisondateToCompare
- the date value to be compared with the columnpublic void append(java.lang.String columnName, java.lang.String relation, java.sql.Date dateToCompare)
columnName
- the column name to be used for the date comparisonrelation
- the relation to be used (e.g. <, >)dateToCompare
- the date value to be compared with the columnto deal with null values
public void appendLowerEqual(DateAttribute dateAttribute, java.sql.Date dateToCompare, DataObject dataObject)
dateAttribute
- the attribute containing the column namedateToCompare
- the date to comparedataObject
- the data object whose SQL dialect is to be satisfiedpublic void appendLowerEqual(java.lang.String columnName, java.sql.Date dateToCompare, DataObject dataObject)
fieldName
- the name of the conditional date fielddateToCompare
- the date to comparedataObject
- the data object whose SQL dialect is to be satisfiedpublic void append(java.lang.String conditionFragement)
conditionFragement
- the condition fragmentprotected void fill(java.sql.PreparedStatement stmt) throws java.sql.SQLException
stmt
- the prepared statement to fill with valuesjava.sql.SQLException
protected void append(java.lang.StringBuilder queryExpression)
queryExpression
- the query expression to be extended by the where condition phrasepublic int size()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de