public class SQLQuery<T> extends Object implements ISpaceQuery<T>, Serializable
'yyyy-mm-dd hh:mm:ss' - i.e. '2004-12-20 20:40:10''hh:mm:ss' - i.e. '20:40:10'| Constructor and Description | 
|---|
SQLQuery()
Empty constructor. 
 | 
SQLQuery(Class<T> type,
        String sqlExpression)
Creates a SQLQuery using the specified type and expression. 
 | 
SQLQuery(Class<T> type,
        String sqlExpression,
        Object... parameters)
Creates a SQLQuery using the specified type, expression and parameters. 
 | 
SQLQuery(Class<T> type,
        String sqlExpression,
        QueryResultType queryResultType)
Creates a SQLQuery using the specified type, expression and result type. 
 | 
SQLQuery(Class<T> type,
        String sqlExpression,
        QueryResultType queryResultType,
        Object... parameters)
Creates a SQLQuery using the specified type, expression, result type and parameters. 
 | 
SQLQuery(String typeName,
        String sqlExpression)
Creates a SQLQuery using the specified type and expression. 
 | 
SQLQuery(String typeName,
        String sqlExpression,
        Object... parameters)
Creates a SQLQuery using the specified type, expression and parameters. 
 | 
SQLQuery(String typeName,
        String sqlExpression,
        QueryResultType queryResultType)
Creates a SQLQuery using the specified type, expression and result type. 
 | 
SQLQuery(String typeName,
        String sqlExpression,
        QueryResultType queryResultType,
        Object... parameters)
Creates a SQLQuery using the specified type, expression, result type and parameters. 
 | 
SQLQuery(T object,
        String sqlQuery)
Deprecated. 
 
Use  
SQLQuery(Class, String) or SQLQuery(String, String)
 instead. | 
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
equals(Object obj)
Indicates whether some  
SQLQuery is "equal to" this one. | 
ExplainPlan | 
getExplainPlan()  | 
String | 
getFromQuery()
Returns a string representation of this SQLQuery, in the form of: 
 | 
T | 
getObject()
Deprecated. 
 
Use SQLQuery with parameters instead of a template. 
 | 
Object[] | 
getParameters()  | 
String[] | 
getProjections()
Returns the projections set on this query, null means no projection is used and all the
 properties should be returned. 
 | 
String | 
getQuery()
Returns the 'WHERE' part of this SQL Query. 
 | 
QueryResultType | 
getQueryResultType()
Returns the result type of this query. 
 | 
Object | 
getRouting()
Gets the routing value of this query. 
 | 
String | 
getSelectAllQuery()
Returns a string representation of this SQLQuery, in the form of: 
 | 
String | 
getSelectCountQuery()
Returns a string representation of this SQLQuery, in the form of: 
 | 
String | 
getTypeName()
Returns the name of the type which will be queried. 
 | 
int | 
hashCode()  | 
boolean | 
hasParameters()  | 
boolean | 
hasWhereClause()
Returns true if the query has a where clause. 
 | 
boolean | 
isNullExpression()
This method should be used for check expression string. 
 | 
boolean | 
isStoredProcedure()
Returns true if this query is a stored procedure 
 | 
SQLQuery<T> | 
setParameter(int index,
            Object value)
Set the query parameter value. 
 | 
void | 
setParameters(Object... parameters)  | 
SQLQuery<T> | 
setProjections(String... properties)
Sets projection properties which specifies that a result for an operation using this query
 should contain data for the specified projection properties. 
 | 
void | 
setRouting(Object routing)
Sets the routing value of this query. 
 | 
String | 
toString()
Returns a string representation of this SQLQuery, in the form of: 
 | 
SQLQuery<T> | 
withExplainPlan()  | 
public SQLQuery()
public SQLQuery(String typeName, String sqlExpression)
typeName - Entry type to be queried.sqlExpression - The SQL Query expression (contents of the WHERE part).public SQLQuery(String typeName, String sqlExpression, QueryResultType queryResultType)
typeName - Entry type to be queried.sqlExpression - The SQL Query expression (contents of the WHERE part).queryResultType - Type of result.public SQLQuery(String typeName, String sqlExpression, Object... parameters)
typeName - Entry type to be queried.sqlExpression - The SQL Query expression (contents of the WHERE part).parameters - Parameters for the sql query.public SQLQuery(String typeName, String sqlExpression, QueryResultType queryResultType, Object... parameters)
typeName - Entry type to be queried.sqlExpression - The SQL Query expression (contents of the WHERE part).queryResultType - Type of result.parameters - Parameters for the sql query.public SQLQuery(Class<T> type, String sqlExpression)
type - Entry class  to be queried.sqlExpression - The SQL Query expression (contents of the WHERE part).public SQLQuery(Class<T> type, String sqlExpression, QueryResultType queryResultType)
type - Entry type to be queried.sqlExpression - The SQL Query expression (contents of the WHERE part).queryResultType - Type of result.public SQLQuery(Class<T> type, String sqlExpression, Object... parameters)
type - Entry type to be queried.sqlExpression - The SQL Query expression (contents of the WHERE part).parameters - Parameters for the sql query.public SQLQuery(Class<T> type, String sqlExpression, QueryResultType queryResultType, Object... parameters)
type - Entry type to be queried.sqlExpression - The SQL Query expression (contents of the WHERE part).queryResultType - Type of result.parameters - Parameters for the sql query.@Deprecated public SQLQuery(T object, String sqlQuery)
SQLQuery(Class, String) or SQLQuery(String, String)
 instead.public ExplainPlan getExplainPlan()
@Deprecated public T getObject()
public String getTypeName()
public boolean isNullExpression()
true if expression is null or emptypublic String getQuery()
public String getFromQuery()
FROM table name WHERE query expression
public String getSelectAllQuery()
SELECT * FROM table name WHERE query expression
public String getSelectCountQuery()
SELECT count(*) FROM table name WHERE query expression
public String toString()
SELECT * FROM table name WHERE query expression
public boolean isStoredProcedure()
true if represents a stored procedurepublic boolean hasWhereClause()
true has a "where" partpublic Object[] getParameters()
public boolean hasParameters()
public void setParameters(Object... parameters)
parameters - the parameters to setpublic SQLQuery<T> setParameter(int index, Object value)
index - parameter index - start with 1value - parameter valuepublic QueryResultType getQueryResultType()
public void setRouting(Object routing)
routing - The routing valuepublic Object getRouting()
public SQLQuery<T> setProjections(String... properties)
public String[] getProjections()
Copyright © GigaSpaces.