Liferay 6.0.5

com.liferay.util.dao.orm
Class CustomSQL

java.lang.Object
  extended by com.liferay.util.dao.orm.CustomSQL

public class CustomSQL
extends Object


Field Summary
static String DB2_FUNCTION_IS_NOT_NULL
           
static String DB2_FUNCTION_IS_NULL
           
static String INFORMIX_FUNCTION_IS_NOT_NULL
           
static String INFORMIX_FUNCTION_IS_NULL
           
static String MYSQL_FUNCTION_IS_NOT_NULL
           
static String MYSQL_FUNCTION_IS_NULL
           
static String SYBASE_FUNCTION_IS_NOT_NULL
           
static String SYBASE_FUNCTION_IS_NULL
           
 
Constructor Summary
CustomSQL()
           
 
Method Summary
 String appendCriteria(String sql, String criteria)
           
 String get(String id)
           
protected  String[] getConfigs()
           
 boolean isVendorDB2()
          Returns true if Hibernate is connecting to a DB2 database.
 boolean isVendorInformix()
          Returns true if Hibernate is connecting to an Informix database.
 boolean isVendorMySQL()
          Returns true if Hibernate is connecting to a MySQL database.
 boolean isVendorOracle()
          Returns true if Hibernate is connecting to an Oracle database.
 boolean isVendorPostgreSQL()
          Returns true if Hibernate is connecting to a PostgreSQL database.
 boolean isVendorSybase()
          Returns true if Hibernate is connecting to a Sybase database.
 String[] keywords(String keywords)
           
 String[] keywords(String[] keywordsArray)
           
 String[] keywords(String[] keywordsArray, boolean lowerCase)
           
 String[] keywords(String keywords, boolean lowerCase)
           
protected  void read(ClassLoader classLoader, String source)
           
 String removeGroupBy(String sql)
           
 String removeOrderBy(String sql)
           
 String replaceAndOperator(String sql, boolean andOperator)
           
 String replaceGroupBy(String sql, String groupBy)
           
 String replaceIsNull(String sql)
           
 String replaceKeywords(String sql, String field, boolean last, int[] values)
           
 String replaceKeywords(String sql, String field, boolean last, long[] values)
           
 String replaceKeywords(String sql, String field, String operator, boolean last, String[] values)
           
 String replaceOrderBy(String sql, OrderByComparator obc)
           
protected  String transform(String sql)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DB2_FUNCTION_IS_NOT_NULL

public static final String DB2_FUNCTION_IS_NOT_NULL
See Also:
Constant Field Values

DB2_FUNCTION_IS_NULL

public static final String DB2_FUNCTION_IS_NULL
See Also:
Constant Field Values

INFORMIX_FUNCTION_IS_NOT_NULL

public static final String INFORMIX_FUNCTION_IS_NOT_NULL
See Also:
Constant Field Values

INFORMIX_FUNCTION_IS_NULL

public static final String INFORMIX_FUNCTION_IS_NULL
See Also:
Constant Field Values

MYSQL_FUNCTION_IS_NOT_NULL

public static final String MYSQL_FUNCTION_IS_NOT_NULL
See Also:
Constant Field Values

MYSQL_FUNCTION_IS_NULL

public static final String MYSQL_FUNCTION_IS_NULL
See Also:
Constant Field Values

SYBASE_FUNCTION_IS_NOT_NULL

public static final String SYBASE_FUNCTION_IS_NOT_NULL
See Also:
Constant Field Values

SYBASE_FUNCTION_IS_NULL

public static final String SYBASE_FUNCTION_IS_NULL
See Also:
Constant Field Values
Constructor Detail

CustomSQL

public CustomSQL()
          throws SQLException
Throws:
SQLException
Method Detail

appendCriteria

public String appendCriteria(String sql,
                             String criteria)

get

public String get(String id)

isVendorDB2

public boolean isVendorDB2()
Returns true if Hibernate is connecting to a DB2 database.

Returns:
true if Hibernate is connecting to a DB2 database

isVendorInformix

public boolean isVendorInformix()
Returns true if Hibernate is connecting to an Informix database.

Returns:
true if Hibernate is connecting to an Informix database

isVendorMySQL

public boolean isVendorMySQL()
Returns true if Hibernate is connecting to a MySQL database.

Returns:
true if Hibernate is connecting to a MySQL database

isVendorOracle

public boolean isVendorOracle()
Returns true if Hibernate is connecting to an Oracle database. Oracle has a nasty bug where it treats '' as a NULL value. See http://thedailywtf.com/forums/thread/26879.aspx for more information on this nasty bug.

Returns:
true if Hibernate is connecting to an Oracle database

isVendorPostgreSQL

public boolean isVendorPostgreSQL()
Returns true if Hibernate is connecting to a PostgreSQL database.

Returns:
true if Hibernate is connecting to a PostgreSQL database

isVendorSybase

public boolean isVendorSybase()
Returns true if Hibernate is connecting to a Sybase database.

Returns:
true if Hibernate is connecting to a Sybase database

keywords

public String[] keywords(String keywords)

keywords

public String[] keywords(String keywords,
                         boolean lowerCase)

keywords

public String[] keywords(String[] keywordsArray)

keywords

public String[] keywords(String[] keywordsArray,
                         boolean lowerCase)

removeGroupBy

public String removeGroupBy(String sql)

removeOrderBy

public String removeOrderBy(String sql)

replaceAndOperator

public String replaceAndOperator(String sql,
                                 boolean andOperator)

replaceIsNull

public String replaceIsNull(String sql)

replaceKeywords

public String replaceKeywords(String sql,
                              String field,
                              boolean last,
                              int[] values)

replaceKeywords

public String replaceKeywords(String sql,
                              String field,
                              boolean last,
                              long[] values)

replaceKeywords

public String replaceKeywords(String sql,
                              String field,
                              String operator,
                              boolean last,
                              String[] values)

replaceGroupBy

public String replaceGroupBy(String sql,
                             String groupBy)

replaceOrderBy

public String replaceOrderBy(String sql,
                             OrderByComparator obc)

getConfigs

protected String[] getConfigs()

read

protected void read(ClassLoader classLoader,
                    String source)
             throws Exception
Throws:
Exception

transform

protected String transform(String sql)

Liferay 6.0.5