Package overit.geocall.sql
Class SqlShortCut
java.lang.Object
overit.geocall.sql.SqlShortCut
This class exposes some utility methods that can be used to quickly create Sql clauses
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetInsertValues(HashSet fields) Returns a string in which every element of theHashSetpassed as parameter is separated from the others by a comma character.static StringgetSequenceClause(PooledConnection conn, String tableName) Returns the correct string that must be used to address the sequence in the Sql clause, depending on theDBTypestatic StringgetWhereInAnd(String[] ss) Returns an Sqlwhereclause, starting from the array of strings passed as parameter.
-
Constructor Details
-
SqlShortCut
public SqlShortCut()
-
-
Method Details
-
getSequenceClause
Returns the correct string that must be used to address the sequence in the Sql clause, depending on theDBType- Parameters:
conn- ThePooledConnectionusedtableName- The name of the table for which we want to create the clause- Returns:
- The string that address correctly the sequence
-
getWhereInAnd
Returns an Sqlwhereclause, starting from the array of strings passed as parameter. Every item in the array is inserted between two round brackets, to allow to insert complex clauses- Parameters:
ss- The array of strings that will be used to compose theWhereclause- Returns:
- A Sql
whereclause containing the items of the array
-
getInsertValues
Returns a string in which every element of theHashSetpassed as parameter is separated from the others by a comma character.- Parameters:
fields- A set of objects- Returns:
- A string that can be used as a list of values for an
insertSql clause
-