org.xerial.db.sql
Class SQLUtil

java.lang.Object
  extended by org.xerial.db.sql.SQLUtil

public class SQLUtil
extends Object

Utilities to generate SQL expressions

Author:
leo

Nested Class Summary
static class SQLUtil.QuotationType
           
 
Method Summary
static String commaSeparatedList(Collection list, SQLUtil.QuotationType quotationType)
          Generates the comma-separated string of the given data
static
<E> String
commaSeparatedList(E[] list, SQLUtil.QuotationType quotationType)
          Generates the comma-separated string of the given data
static String doubleQuote(String input)
          Adds a double quotation to the input value
static String separatedList(Collection list, String separator, SQLUtil.QuotationType quotationType)
          Generates the concatenation of the given elements in the list
static String singleQuote(String input)
          Adds a single quotation to the input value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

commaSeparatedList

public static String commaSeparatedList(Collection list,
                                        SQLUtil.QuotationType quotationType)
Generates the comma-separated string of the given data

Parameters:
list - the elements to concatenate
quotationType - the quotation type ( SQLUtil.QuotationType )
Returns:
the comma-separated string of the given data

commaSeparatedList

public static <E> String commaSeparatedList(E[] list,
                                            SQLUtil.QuotationType quotationType)
Generates the comma-separated string of the given data

Parameters:
list - the elements to concatenate
quotationType - the quotation type ( SQLUtil.QuotationType )
Returns:
the comma-separated string of the given data

separatedList

public static String separatedList(Collection list,
                                   String separator,
                                   SQLUtil.QuotationType quotationType)
Generates the concatenation of the given elements in the list

Parameters:
list - the elements to concatenate
separator - the separator
quotationType - the quotation type ( SQLUtil.QuotationType )
Returns:
the concatenation of each element in the list separated via the given separator

doubleQuote

public static String doubleQuote(String input)
Adds a double quotation to the input value

Parameters:
input -
Returns:

singleQuote

public static String singleQuote(String input)
Adds a single quotation to the input value

Parameters:
input -
Returns:


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.