com.scooterframework.orm.sqldataexpress.service
Class SqlServiceClient

java.lang.Object
  extended by com.scooterframework.orm.sqldataexpress.service.SqlServiceClient

public class SqlServiceClient
extends java.lang.Object

SqlServiceClient class has helper methods on using SqlService.


Constructor Summary
SqlServiceClient()
           
 
Method Summary
static int executeSQL(java.lang.String sql)
          Executes a non-select SQL statement and returns count of updated rows.
static int executeSQL(java.lang.String sql, java.util.Map<java.lang.String,java.lang.Object> inputs)
          Executes a non-select SQL statement and returns count of updated rows.
static int executeSQLByKey(java.lang.String sqlKey)
          Retrieves an object from database based on the SQL query related to the SQL key.
static int executeSQLByKey(java.lang.String sqlKey, java.util.Map<java.lang.String,java.lang.Object> inputs)
          Executes a non-select SQL statement corresponding to a name key and returns count of updated rows.
static SqlService getSqlService()
          Returns SqlService
static java.lang.Object retrieveObjectBySQL(java.lang.String sql)
          Retrieves one object from database based on the SQL input.
static java.lang.Object retrieveObjectBySQL(java.lang.String sql, java.util.Map<java.lang.String,java.lang.Object> inputs)
          Retrieves one object from database based on the SQL input.
static java.lang.Object retrieveObjectBySQLKey(java.lang.String sqlKey)
          Retrieves an object from database based on the SQL query related to the SQL key.
static java.lang.Object retrieveObjectBySQLKey(java.lang.String sqlKey, java.util.Map<java.lang.String,java.lang.Object> inputs)
          Retrieves an object from database based on the SQL query related to the sql key.
static RowData retrieveOneRowBySQL(java.lang.String sql)
          Retrieves one RowData from database based on the SQL input.
static RowData retrieveOneRowBySQL(java.lang.String sql, java.util.Map<java.lang.String,java.lang.Object> inputs)
          Retrieves one RowData from database based on the SQL input.
static RowData retrieveOneRowBySQLKey(java.lang.String sqlKey, java.util.Map<java.lang.String,java.lang.Object> inputs)
          Retrieves one RowData from database based on the SQL query related to the SQL key.
static RowData retrieveOneRowsBySQLKey(java.lang.String sqlKey)
          Retrieves one RowData from database based on the SQL query related to the SQL key.
static java.util.List<RowData> retrieveRowsBySQL(java.lang.String sql)
          Retrieves RowData list from database based on the SQL input.
static java.util.List<RowData> retrieveRowsBySQL(java.lang.String sql, java.util.Map<java.lang.String,java.lang.Object> inputs)
          Retrieves RowData list from database based on the SQL input.
static java.util.List<RowData> retrieveRowsBySQLKey(java.lang.String sqlKey)
          Retrieves RowData list from database based on the SQL query related to the SQL key.
static java.util.List<RowData> retrieveRowsBySQLKey(java.lang.String sqlKey, java.util.Map<java.lang.String,java.lang.Object> inputs)
          Retrieves RowData list from database based on the SQL query related to the SQL key.
static TableData retrieveTableDataBySQL(java.lang.String sql)
          Retrieves TableData from database based on the SQL input.
static TableData retrieveTableDataBySQL(java.lang.String sql, java.util.Map<java.lang.String,java.lang.Object> inputs)
          Retrieves TableData from database based on the SQL input.
static TableData retrieveTableDataBySQLKey(java.lang.String sqlKey)
          Retrieves TableData from database based on the SQL query related to the SQL key.
static TableData retrieveTableDataBySQLKey(java.lang.String sqlKey, java.util.Map<java.lang.String,java.lang.Object> inputs)
          Retrieves TableData from database based on the SQL query related to the SQL key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlServiceClient

public SqlServiceClient()
Method Detail

retrieveTableDataBySQL

public static TableData retrieveTableDataBySQL(java.lang.String sql)
Retrieves TableData from database based on the SQL input.

Parameters:
sql - a valid SQL statement string
Returns:
a TableData instance returned from the database.

retrieveTableDataBySQL

public static TableData retrieveTableDataBySQL(java.lang.String sql,
                                               java.util.Map<java.lang.String,java.lang.Object> inputs)
Retrieves TableData from database based on the SQL input.

Parameters:
sql - a valid SQL statement string
inputs - a map of name and value pairs
Returns:
a TableData instance returned from the database.

retrieveTableDataBySQLKey

public static TableData retrieveTableDataBySQLKey(java.lang.String sqlKey)
Retrieves TableData from database based on the SQL query related to the SQL key.

Parameters:
sqlKey - key to a SQL statement
Returns:
a TableData instance returned from the database.

retrieveTableDataBySQLKey

public static TableData retrieveTableDataBySQLKey(java.lang.String sqlKey,
                                                  java.util.Map<java.lang.String,java.lang.Object> inputs)
Retrieves TableData from database based on the SQL query related to the SQL key.

Parameters:
sqlKey - key to a SQL statement
inputs - a map of name and value pairs
Returns:
a TableData instance returned from the database.

retrieveRowsBySQLKey

public static java.util.List<RowData> retrieveRowsBySQLKey(java.lang.String sqlKey)
Retrieves RowData list from database based on the SQL query related to the SQL key.

Parameters:
sqlKey - key to a SQL statement
Returns:
a list of RowData objects returned from the database.

retrieveRowsBySQLKey

public static java.util.List<RowData> retrieveRowsBySQLKey(java.lang.String sqlKey,
                                                           java.util.Map<java.lang.String,java.lang.Object> inputs)
Retrieves RowData list from database based on the SQL query related to the SQL key.

Parameters:
sqlKey - key to a SQL statement
inputs - a map of name and value pairs
Returns:
a lList of RowData objects returned from the database.

retrieveRowsBySQL

public static java.util.List<RowData> retrieveRowsBySQL(java.lang.String sql)
Retrieves RowData list from database based on the SQL input.

Parameters:
sql - a SQL statement
Returns:
a list of RowData objects returned from the database.

retrieveRowsBySQL

public static java.util.List<RowData> retrieveRowsBySQL(java.lang.String sql,
                                                        java.util.Map<java.lang.String,java.lang.Object> inputs)
Retrieves RowData list from database based on the SQL input.

Parameters:
sql - a SQL statement
inputs - a map of name and value pairs
Returns:
a list of RowData objects returned from the database.

retrieveOneRowsBySQLKey

public static RowData retrieveOneRowsBySQLKey(java.lang.String sqlKey)
Retrieves one RowData from database based on the SQL query related to the SQL key. The first row of the query result is returned.

Parameters:
sqlKey - key to a SQL statement
Returns:
a RowData object returned from the database.

retrieveOneRowBySQLKey

public static RowData retrieveOneRowBySQLKey(java.lang.String sqlKey,
                                             java.util.Map<java.lang.String,java.lang.Object> inputs)
Retrieves one RowData from database based on the SQL query related to the SQL key. The first row of the query result is returned.

Parameters:
sqlKey - key to a SQL statement
inputs - a map of name and value pairs
Returns:
a RowData object returned from the database.

retrieveOneRowBySQL

public static RowData retrieveOneRowBySQL(java.lang.String sql)
Retrieves one RowData from database based on the SQL input. The first row of the query result is returned.

Parameters:
sql - a SQL statement
Returns:
a RowData object returned from the database.

retrieveOneRowBySQL

public static RowData retrieveOneRowBySQL(java.lang.String sql,
                                          java.util.Map<java.lang.String,java.lang.Object> inputs)
Retrieves one RowData from database based on the SQL input. The first row of the query result is returned.

Parameters:
sql - a SQL statement
inputs - a map of name and value pairs
Returns:
a RowData object returned from the database.

retrieveObjectBySQL

public static java.lang.Object retrieveObjectBySQL(java.lang.String sql)
Retrieves one object from database based on the SQL input. The object of the first column of the first row is returned.

Parameters:
sql - a SQL statement
Returns:
an Object value returned from the database.

retrieveObjectBySQL

public static java.lang.Object retrieveObjectBySQL(java.lang.String sql,
                                                   java.util.Map<java.lang.String,java.lang.Object> inputs)
Retrieves one object from database based on the SQL input. The object of the first column of the first row is returned.

Parameters:
sql - a SQL statement
inputs - a map of name and value pairs
Returns:
an Object value returned from the database.

retrieveObjectBySQLKey

public static java.lang.Object retrieveObjectBySQLKey(java.lang.String sqlKey)
Retrieves an object from database based on the SQL query related to the SQL key. The object of the first column of the first row is returned.

Parameters:
sqlKey - key to a SQL statement
Returns:
an Object value returned from the database.

retrieveObjectBySQLKey

public static java.lang.Object retrieveObjectBySQLKey(java.lang.String sqlKey,
                                                      java.util.Map<java.lang.String,java.lang.Object> inputs)
Retrieves an object from database based on the SQL query related to the sql key. The object of the first column of the first row is returned.

Parameters:
sqlKey - key to a SQL statement
inputs - a map of name and value pairs
Returns:
an Object value returned from the database.

executeSQL

public static int executeSQL(java.lang.String sql)
Executes a non-select SQL statement and returns count of updated rows.

Parameters:
sql - a SQL statement
Returns:
updated row count

executeSQL

public static int executeSQL(java.lang.String sql,
                             java.util.Map<java.lang.String,java.lang.Object> inputs)
Executes a non-select SQL statement and returns count of updated rows.

Parameters:
sql - a SQL statement
inputs - a map of name and value pairs
Returns:
updated row count

executeSQLByKey

public static int executeSQLByKey(java.lang.String sqlKey)
Retrieves an object from database based on the SQL query related to the SQL key.

Parameters:
sqlKey - key to a SQL statement
Returns:
updated row count

executeSQLByKey

public static int executeSQLByKey(java.lang.String sqlKey,
                                  java.util.Map<java.lang.String,java.lang.Object> inputs)
Executes a non-select SQL statement corresponding to a name key and returns count of updated rows.

Parameters:
sqlKey - key to a SQL statement
inputs - a map of name and value pairs
Returns:
updated row count

getSqlService

public static SqlService getSqlService()
Returns SqlService

Returns:
SqlService