Package anderix.datajets
Class SqlBuilder
java.lang.Object
anderix.datajets.SqlBuilder
Facilitates creation of SQL statements in an object-oriented manner. The basic 
use of a SqlBuilder object follows this pattern:
- Instantiate SqlBuilder object
- Define table to connect to
- Define fields in that table
- Define identity field (if applicable)
- Set field values (if applicable)
- Return completed SQL statement
SELECT statement:
//Example: creating a SELECT statement
SqlBuilder sql = new SqlBuilder;
String table = "my_table";
sql.setTable(table);
String[] fields = new String[]{"field1", "field2"};
sql.setFieldList(fields);
System.out.println(sql.selectStatement());
SqlBuilder contains methods for adding WHERE clauses to 
SELECT, INSERT, UPDATE, and 
DELETE statements. There are also methods for adding
JOIN, GROUP BY, HAVING, 
and ORDER BY clauses to SELECT statements. 
Calling these methods for INSERT, UPDATE or 
DELETE statements will have no effect.
Some statments require that the identity field be specified. This can be done 
in the setFieldList method or in an appropriate constructor. The 
methods that require an identity field are:
- selectByIdStatement
- updateByIdStatement
- deleteByIdStatement
INSERT or UPDATE statment, you may
populate parameter values by calling setValue or 
setValueToNull. If you do not set field values, the statement
will be returned with ? as a placeholder value.
If SqlBuilder does not have enough information to create the requested SQL statement, it will return an empty string ("");
- 
Constructor SummaryConstructorsConstructorDescriptionConstructor that does not establish table, fields or identity field.SqlBuilder(String table) Constructor that establishes table.SqlBuilder(String table, String[] fields) Constructor that establishes table and fields.SqlBuilder(String table, String[] fields, int idFieldIndex) Constructor that establishes table, fields, and identity field.SqlBuilder(String table, String[] fields, String idField) Constructor that establishes table, fields, and identity field.SqlBuilder(String table, String[] fields, String[] fieldProperties, int idFieldIndex) Constructor that establishes table, fields, field properties and identity field.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a single field to the field list.voidandHaving(int fieldIndex, Comparison operator, boolean value) Adds aHAVINGclause to aSELECTstatement withAND.voidandHaving(int fieldIndex, Comparison operator, byte value) Adds aHAVINGclause to aSELECTstatement withAND.voidandHaving(int fieldIndex, Comparison operator, double value) Adds aHAVINGclause to aSELECTstatement withAND.voidandHaving(int fieldIndex, Comparison operator, float value) Adds aHAVINGclause to aSELECTstatement withAND.voidandHaving(int fieldIndex, Comparison operator, int value) Adds aHAVINGclause to aSELECTstatement withAND.voidandHaving(int fieldIndex, Comparison operator, short value) Adds aHAVINGclause to aSELECTstatement withAND.voidandHaving(int fieldIndex, Comparison operator, String value) Adds aHAVINGclause to aSELECTstatement withAND.voidandHaving(int fieldIndex, Comparison operator, Date value) Adds aHAVINGclause to aSELECTstatement withAND.voidAdds aHAVINGclause to aSELECTstatement withAND.voidandHaving(String fieldName, Comparison operator, boolean value) Adds aHAVINGclause to aSELECTstatement withAND.voidandHaving(String fieldName, Comparison operator, byte value) Adds aHAVINGclause to aSELECTstatement withAND.voidandHaving(String fieldName, Comparison operator, double value) Adds aHAVINGclause to aSELECTstatement withAND.voidandHaving(String fieldName, Comparison operator, float value) Adds aHAVINGclause to aSELECTstatement withAND.voidandHaving(String fieldName, Comparison operator, int value) Adds aHAVINGclause to aSELECTstatement withAND.voidandHaving(String fieldName, Comparison operator, short value) Adds aHAVINGclause to aSELECTstatement withAND.voidandHaving(String fieldName, Comparison operator, String value) Adds aHAVINGclause to aSELECTstatement withAND.voidandHaving(String fieldName, Comparison operator, Date value) Adds aHAVINGclause to aSELECTstatement withAND.voidandWhere(int fieldIndex, Comparison operator, boolean value) Adds aWHEREclause to an SQL statement withAND.voidandWhere(int fieldIndex, Comparison operator, byte value) Adds aWHEREclause to an SQL statement withAND.voidandWhere(int fieldIndex, Comparison operator, double value) Adds aWHEREclause to an SQL statement withAND.voidandWhere(int fieldIndex, Comparison operator, float value) Adds aWHEREclause to an SQL statement withAND.voidandWhere(int fieldIndex, Comparison operator, int value) Adds aWHEREclause to an SQL statement withAND.voidandWhere(int fieldIndex, Comparison operator, short value) Adds aWHEREclause to an SQL statement withAND.voidandWhere(int fieldIndex, Comparison operator, String value) Adds aWHEREclause to an SQL statement withAND.voidandWhere(int fieldIndex, Comparison operator, Date value) Adds aWHEREclause to an SQL statement withAND.voidAdds aWHEREclause to an SQL statement withAND.voidandWhere(String fieldName, Comparison operator, boolean value) Adds aWHEREclause to an SQL statement withAND.voidandWhere(String fieldName, Comparison operator, byte value) Adds aWHEREclause to an SQL statement withAND.voidandWhere(String fieldName, Comparison operator, double value) Adds aWHEREclause to an SQL statement withAND.voidandWhere(String fieldName, Comparison operator, float value) Adds aWHEREclause to an SQL statement withAND.voidandWhere(String fieldName, Comparison operator, int value) Adds aWHEREclause to an SQL statement withAND.voidandWhere(String fieldName, Comparison operator, short value) Adds aWHEREclause to an SQL statement withAND.voidandWhere(String fieldName, Comparison operator, String value) Adds aWHEREclause to an SQL statement withAND.voidandWhere(String fieldName, Comparison operator, Date value) Adds aWHEREclause to an SQL statement withAND.Creates aCREATE TABLEstatement based on supplied values.deleteByIdStatement(int idToDelete) Creates anDELETEstatement based on supplied values.Creates anDELETEstatement based on supplied values.static StringModifies a string so it will be processed as a complete string within SQL.String[]Returns array of strings representing field names already established.getTable()Returns string representing table name already established.voidgroupBy(int groupByFieldIndex) Adds aGROUP BYclause to aSELECTstatement.voidAdds aGROUP BYclause to aSELECTstatement.Creates aINSERTstatement based on supplied values.voidAdds aJOINclause to an SQL statement.voidjoin(JoinType joinType, String tableToJoin, String fieldInFirstTable, Comparison operator, String fieldInTableToJoin) Adds aJOINclause to an SQL statement.voidAdds anINNER JOINclause to an SQL statement.voidjoin(String tableToJoin, String fieldInFirstTable, Comparison operator, String fieldInTableToJoin) Adds anINNER JOINclause to an SQL statement.voidAdds anINNER JOINclause to an SQL statement.voidorderBy(int orderByFieldIndex, OrderDirection direction) Adds anORDER BYclause to aSELECTstatement withdirectionas the direction.voidorderBy(String orderByField, OrderDirection direction) Adds aORDER BYclause to aSELECTstatement withdirectionas the direction.voidorderByAscending(int orderByFieldIndex) Adds anORDER BYclause to aSELECTstatement withASCas the direction.voidorderByAscending(String orderByField) Adds aORDER BYclause to aSELECTstatement withASCas the direction.voidorderByDescending(int orderByFieldIndex) Adds anORDER BYclause to aSELECTstatement withDESCas the direction.voidorderByDescending(String orderByField) Adds aORDER BYclause to aSELECTstatement withDESCas the direction.voidorHaving(int fieldIndex, Comparison operator, boolean value) Adds aHAVINGclause to aSELECTstatement withOR.voidorHaving(int fieldIndex, Comparison operator, byte value) Adds aHAVINGclause to aSELECTstatement withOR.voidorHaving(int fieldIndex, Comparison operator, double value) Adds aHAVINGclause to aSELECTstatement withOR.voidorHaving(int fieldIndex, Comparison operator, float value) Adds aHAVINGclause to aSELECTstatement withOR.voidorHaving(int fieldIndex, Comparison operator, int value) Adds aHAVINGclause to aSELECTstatement withOR.voidorHaving(int fieldIndex, Comparison operator, short value) Adds aHAVINGclause to aSELECTstatement withOR.voidorHaving(int fieldIndex, Comparison operator, String value) Adds aHAVINGclause to aSELECTstatement withOR.voidorHaving(int fieldIndex, Comparison operator, Date value) Adds aHAVINGclause to aSELECTstatement withOR.voidAdds aHAVINGclause to aSELECTstatement withOR.voidorHaving(String fieldName, Comparison operator, boolean value) Adds aHAVINGclause to aSELECTstatement withOR.voidorHaving(String fieldName, Comparison operator, byte value) Adds aHAVINGclause to aSELECTstatement withOR.voidorHaving(String fieldName, Comparison operator, double value) Adds aHAVINGclause to aSELECTstatement withOR.voidorHaving(String fieldName, Comparison operator, float value) Adds aHAVINGclause to aSELECTstatement withOR.voidorHaving(String fieldName, Comparison operator, int value) Adds aHAVINGclause to aSELECTstatement withOR.voidorHaving(String fieldName, Comparison operator, short value) Adds aHAVINGclause to aSELECTstatement withOR.voidorHaving(String fieldName, Comparison operator, String value) Adds aHAVINGclause to aSELECTstatement withOR.voidorHaving(String fieldName, Comparison operator, Date value) Adds aHAVINGclause to aSELECTstatement withOR.voidorWhere(int fieldIndex, Comparison operator, boolean value) Adds aWHEREclause to an SQL statement withOR.voidorWhere(int fieldIndex, Comparison operator, byte value) Adds aWHEREclause to an SQL statement withOR.voidorWhere(int fieldIndex, Comparison operator, double value) Adds aWHEREclause to an SQL statement withOR.voidorWhere(int fieldIndex, Comparison operator, float value) Adds aWHEREclause to an SQL statement withOR.voidorWhere(int fieldIndex, Comparison operator, int value) Adds aWHEREclause to an SQL statement withOR.voidorWhere(int fieldIndex, Comparison operator, short value) Adds aWHEREclause to an SQL statement withOR.voidorWhere(int fieldIndex, Comparison operator, String value) Adds aWHEREclause to an SQL statement withOR.voidorWhere(int fieldIndex, Comparison operator, Date value) Adds aWHEREclause to an SQL statement withOR.voidAdds aWHEREclause to an SQL statement withOR.voidorWhere(String fieldName, Comparison operator, boolean value) Adds aWHEREclause to an SQL statement withOR.voidorWhere(String fieldName, Comparison operator, byte value) Adds aWHEREclause to an SQL statement withOR.voidorWhere(String fieldName, Comparison operator, double value) Adds aWHEREclause to an SQL statement withOR.voidorWhere(String fieldName, Comparison operator, float value) Adds aWHEREclause to an SQL statement withOR.voidorWhere(String fieldName, Comparison operator, int value) Adds aWHEREclause to an SQL statement withOR.voidorWhere(String fieldName, Comparison operator, short value) Adds aWHEREclause to an SQL statement withOR.voidorWhere(String fieldName, Comparison operator, String value) Adds aWHEREclause to an SQL statement withOR.voidorWhere(String fieldName, Comparison operator, Date value) Adds aWHEREclause to an SQL statement withOR.voidprependField(int fieldIndex, String tableName) Prepends the field name with a table name.selectByIdStatement(int idToSelect) Creates aSELECTstatement based on supplied values.Creates aSELECTstatement based on supplied values.voidsetFieldList(String[] fields) Establishes fields.voidsetFieldList(String[] fields, int idFieldIndex) Establishes fields and identity field.voidsetFieldList(String[] fields, String idField) Establishes fields and identity field.voidsetFieldProperties(int fieldIndex, String fieldProperties) Sets properties of a field forCREATE TABLEstatements.voidEstablishes table.voidsetValue(int fieldIndex, boolean fieldValue) Sets value of field forUPDATEandINSERTstatements.voidsetValue(int fieldIndex, byte fieldValue) Sets value of field forUPDATEandINSERTstatements.voidsetValue(int fieldIndex, double fieldValue) Sets value of field forUPDATEandINSERTstatements.voidsetValue(int fieldIndex, float fieldValue) Sets value of field forUPDATEandINSERTstatements.voidsetValue(int fieldIndex, int fieldValue) Sets value of field forUPDATEandINSERTstatements.voidsetValue(int fieldIndex, long fieldValue) Sets value of field forUPDATEandINSERTstatements.voidsetValue(int fieldIndex, short fieldValue) Sets value of field forUPDATEandINSERTstatements.voidSets value of field forUPDATEandINSERTstatements.voidSets value of field forUPDATEandINSERTstatements.voidSets value of field forUPDATEandINSERTstatements.voidSets value of field forUPDATEandINSERTstatements.voidsetValueToNull(int fieldIndex) Sets value of field forUPDATEandINSERTstatements to NULL.updateByIdStatement(int idToUpdate) Creates anUPDATEstatement based on supplied values.Creates anUPDATEstatement based on supplied values.
- 
Constructor Details- 
SqlBuilderConstructor that establishes table, fields, field properties and identity field.- Parameters:
- table- string name of the table in the database
- fields- array of strings representing each field
- fieldProperties- array of strings representing fieldProperties
- idFieldIndex- zero-based ordinal position of field in- fields[]
 
- 
SqlBuilderConstructor that establishes table, fields, and identity field.- Parameters:
- table- string name of the table in the database
- fields- array of strings representing each field
- idFieldIndex- zero-based ordinal position of field in- fields[]
 
- 
SqlBuilderConstructor that establishes table, fields, and identity field.- Parameters:
- table- string name of the table in the database
- fields- array of strings representing each field
- idField- name of identity field
 
- 
SqlBuilderConstructor that establishes table and fields.- Parameters:
- table- string name of the table in the database
- fields- array of strings representing each field
 
- 
SqlBuilderConstructor that establishes table. After instantiation,setFieldListmust be called to populate field list and/or identity field.- Parameters:
- table- string name of the table in the database
 
- 
SqlBuilderpublic SqlBuilder()Constructor that does not establish table, fields or identity field.
 
- 
- 
Method Details- 
setFieldListEstablishes fields and identity field.- Parameters:
- fields- array of strings representing each field
- idFieldIndex- zero-based ordinal position of field in- fields[]
 
- 
setFieldListEstablishes fields and identity field.- Parameters:
- fields- array of strings representing each field
- idField- name of identity field
 
- 
setFieldListEstablishes fields.- Parameters:
- fields- array of strings representing each field
 
- 
getFieldListReturns array of strings representing field names already established.- Returns:
- fields as array of strings
 
- 
addFieldAdds a single field to the field list.- Parameters:
- fieldName- the name of the field to add
 
- 
prependFieldPrepends the field name with a table name. This is used to differentiate fields from different tables that have the same name in queries that joins those tables.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList)
- tableName- name of the table to which the field belongs
 
- 
setTableEstablishes table.- Parameters:
- table- string representing table name
 
- 
getTableReturns string representing table name already established.- Returns:
- table name as string
 
- 
setValuepublic void setValue(int fieldIndex, byte fieldValue) Sets value of field forUPDATEandINSERTstatements.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList)
- fieldValue- value of field as byte
 
- 
setValuepublic void setValue(int fieldIndex, double fieldValue) Sets value of field forUPDATEandINSERTstatements.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList)
- fieldValue- value of field as double
 
- 
setValuepublic void setValue(int fieldIndex, float fieldValue) Sets value of field forUPDATEandINSERTstatements.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList)
- fieldValue- value of field as float
 
- 
setValuepublic void setValue(int fieldIndex, long fieldValue) Sets value of field forUPDATEandINSERTstatements.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList)
- fieldValue- value of field as long
 
- 
setValuepublic void setValue(int fieldIndex, short fieldValue) Sets value of field forUPDATEandINSERTstatements.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList)
- fieldValue- value of field as short
 
- 
setValuepublic void setValue(int fieldIndex, boolean fieldValue) Sets value of field forUPDATEandINSERTstatements.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList)
- fieldValue- value of field as boolean
 
- 
setValueSets value of field forUPDATEandINSERTstatements.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList)
- fieldValue- value of field as java.util.Date
 
- 
setValuepublic void setValue(int fieldIndex, int fieldValue) Sets value of field forUPDATEandINSERTstatements.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList)
- fieldValue- value of field as int
 
- 
setValueToNullpublic void setValueToNull(int fieldIndex) Sets value of field forUPDATEandINSERTstatements to NULL.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList)
 
- 
setValueSets value of field forUPDATEandINSERTstatements.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList)
- fieldValue- value of field as java.lang.String
 
- 
setValueSets value of field forUPDATEandINSERTstatements.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList)
- fieldValue- value of field as java.lang.String
 
- 
setValueSets value of field forUPDATEandINSERTstatements.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList)
- fieldValue- value of field as java.lang.String
 
- 
setFieldPropertiesSets properties of a field forCREATE TABLEstatements.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList)
- fieldProperties- properties of field as java.lang.String
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- string representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- string representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- int representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- int representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- java.util.Date representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- java.util.Date representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- boolean representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- boolean representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- short representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- short representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- float representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- float representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- double representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- double representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- byte representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- byte representing value to compare to field
 
- 
andWhereAdds aWHEREclause to an SQL statement withAND.- Parameters:
- whereStatement- string containing complete- WHEREclause
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- string representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- string representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- int representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- int representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- java.util.Date representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- java.util.Date representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- boolean representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- boolean representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- short representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- short representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- float representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- float representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- double representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- double representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- byte representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- byte representing value to compare to field
 
- 
orWhereAdds aWHEREclause to an SQL statement withOR.- Parameters:
- whereStatement- string containing complete- WHEREclause
 
- 
joinAdds anINNER JOINclause to an SQL statement.- Parameters:
- tableToJoin- name of the table to join
- fieldInFirstTable- name of field in first table
- fieldInTableToJoin- name of field in table specified in tableToJoin
 
- 
joinpublic void join(String tableToJoin, String fieldInFirstTable, Comparison operator, String fieldInTableToJoin) Adds anINNER JOINclause to an SQL statement.- Parameters:
- tableToJoin- name of the table to join
- fieldInFirstTable- name of field in first table
- operator- comparison operator for join
- fieldInTableToJoin- name of field in table specified in tableToJoin
 
- 
joinAdds anINNER JOINclause to an SQL statement.- Parameters:
- tableToJoin- name of the table to join
- onStatement- conditional statement to define the join
 
- 
joinpublic void join(JoinType joinType, String tableToJoin, String fieldInFirstTable, Comparison operator, String fieldInTableToJoin) Adds aJOINclause to an SQL statement.- Parameters:
- joinType- the type of join to add
- tableToJoin- name of the table to join
- fieldInFirstTable- name of field in first table
- operator- comparison operator for join
- fieldInTableToJoin- name of field in table specified in tableToJoin
 
- 
joinAdds aJOINclause to an SQL statement.- Parameters:
- joinType- the type of join to add
- tableToJoin- name of the table to join
- onStatement- conditional statement to define the join
 
- 
groupBypublic void groupBy(int groupByFieldIndex) Adds aGROUP BYclause to aSELECTstatement.- Parameters:
- groupByFieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to group by
 
- 
groupByAdds aGROUP BYclause to aSELECTstatement.- Parameters:
- groupByField- string name of field to group by
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- string representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- string representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- int representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- int representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- java.util.Date representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- java.util.Date representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- boolean representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- boolean representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- short representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- short representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- float representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- float representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- double representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- double representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- byte representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- byte representing value to compare to field
 
- 
andHavingAdds aHAVINGclause to aSELECTstatement withAND.- Parameters:
- havingStatement- string containing complete- HAVINGclause
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- string representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- string representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- int representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- int representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- java.util.Date representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- java.util.Date representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- boolean representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- boolean representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- short representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- short representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- float representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- float representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- double representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- double representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- byte representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- fieldName- string name of field to test versus supplied value.
- operator- Comparison representing the type of comparison operation
- value- byte representing value to compare to field
 
- 
orHavingAdds aHAVINGclause to aSELECTstatement withOR.- Parameters:
- havingStatement- string containing complete- HAVINGclause
 
- 
orderByAscendingpublic void orderByAscending(int orderByFieldIndex) Adds anORDER BYclause to aSELECTstatement withASCas the direction.- Parameters:
- orderByFieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to sort by
 
- 
orderByAscendingAdds aORDER BYclause to aSELECTstatement withASCas the direction.- Parameters:
- orderByField- string name of field to sort by
 
- 
orderByDescendingAdds aORDER BYclause to aSELECTstatement withDESCas the direction.- Parameters:
- orderByField- string name of field to sort by
 
- 
orderByDescendingpublic void orderByDescending(int orderByFieldIndex) Adds anORDER BYclause to aSELECTstatement withDESCas the direction.- Parameters:
- orderByFieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to sort by
 
- 
orderByAdds anORDER BYclause to aSELECTstatement withdirectionas the direction.- Parameters:
- orderByFieldIndex- ordinal position of field in- fields[](as defined in constructor or- setFieldList) to sort by
 
- 
orderByAdds aORDER BYclause to aSELECTstatement withdirectionas the direction.- Parameters:
- orderByField- string name of field to sort by
 
- 
selectByIdStatementCreates aSELECTstatement based on supplied values.- Parameters:
- idToSelect- int representing identity value of specific record to return
- Returns:
- SQL SELECTstatement
 
- 
selectStatementCreates aSELECTstatement based on supplied values.- Returns:
- SQL SELECTstatement
 
- 
insertStatementCreates aINSERTstatement based on supplied values.- Returns:
- SQL INSERTstatement
 
- 
updateByIdStatementCreates anUPDATEstatement based on supplied values.- Parameters:
- idToUpdate- int representing identity value of specific record to update
- Returns:
- SQL UPDATEstatement
 
- 
updateStatementCreates anUPDATEstatement based on supplied values.- Returns:
- SQL UPDATEstatement
 
- 
createTableStatementCreates aCREATE TABLEstatement based on supplied values.- Returns:
- SQL CREATE TABLEstatement
 
- 
deleteByIdStatementCreates anDELETEstatement based on supplied values.- Parameters:
- idToDelete- int representing identity value of specific record to delete
- Returns:
- SQL DELETEstatement
 
- 
deleteStatementCreates anDELETEstatement based on supplied values.- Returns:
- SQL DELETEstatement
 
- 
encodeModifies a string so it will be processed as a complete string within SQL.- Parameters:
- toEncode- the string to encode
- Returns:
- the encoded string
 
 
-