Java Doc for BaseListSqlHelper.java in  » Web-Framework » aranea-mvc-1.1.1 » org » araneaframework » backend » list » helper » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » aranea mvc 1.1.1 » org.araneaframework.backend.list.helper 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.araneaframework.backend.list.helper.BaseListSqlHelper

All known Subclasses:   org.araneaframework.backend.list.helper.ListSqlHelper,
BaseListSqlHelper
abstract public class BaseListSqlHelper (Code)
This class provides an SQL based implementation of the list. It takes care of the filtering, ordering and returning data to the web components. Implementations should override abstract methods noted in those methods.

Note, that all operations on items are made on the list of "processed", that is ordered and filtered items.


author:
   Jevgeni Kabanov (ekabanov at araneaframework dot org)
author:
   Rein Raudjärv
since:
   1.1


Inner Class :public static class ListItemsDataCallback implements ConnectionCallback
Inner Class :public class CountSqlCallback implements ConnectionCallback
Inner Class :public class ItemRangeSqlCallback implements ConnectionCallback
Inner Class :public class BeanResultReader implements ResultReader

Field Summary
final protected static  LongDEFAULT_RANGE_START
    
protected  DataSourceds
    
protected  Fieldsfields
    
protected  ExpressionfilterExpr
    
protected  SqlExpressionfilterSqlExpr
    
protected  LongitemRangeCount
    
protected  LongitemRangeStart
    
protected  NamingStrategynamingStrategy
    
protected  ComparatorExpressionorderExpr
    
protected  SqlExpressionorderSqlExpr
    
protected  ResultSetColumnReaderresultSetColumnReader
    
protected  ValueConvertervalueConverter
    
protected  VariableResolvervariableResolver
    

Constructor Summary
public  BaseListSqlHelper()
     Creates ListSqlHelper without initializing any fields.
public  BaseListSqlHelper(DataSource dataSource)
     Creates ListSqlHelper and provides it with the DataSource.
public  BaseListSqlHelper(ListQuery query)
     Creates ListSqlHelper initializing the appropriate fields.
public  BaseListSqlHelper(DataSource dataSource, ListQuery query)
     Creates ListSqlHelper initializing the appropriate fields and providing it with the DataSource.

Method Summary
abstract public  voidaddNullParam(int valueType)
     Adds a NULL PreparedStatement parameter for later setting.
abstract public  voidaddStatementParam(Object param)
     Adds a PreparedStatement parameter for later setting.
abstract public  voidaddStatementParams(List params)
     Adds PreparedStatement parameters for later setting.
public  ResultReadercreateBeanResultReader(Class itemClass)
     Returns Bean ResultSet reader.
protected  VariableResolvercreateExpressionBuilderResolver()
     Creates the VariableResolver for SqlExpressionBuilder that converts Variable names to their Database Field names according to the naming strategy.
protected  StandardExpressionToSqlExprBuildercreateFilterSqlExpressionBuilder()
     Creates new filtering SQL Expression builder.
protected  StandardCompExprToSqlExprBuildercreateOrderSqlExpressionBuilder()
     Creates new ordering SQL Expression builder.
protected static  RuntimeExceptioncreateQueryFailedException(String QueryString, List queryParams, SQLException nestedException)
     Returns query failed Exception that contains query String and params.
public  Objectexecute(ConnectionCallback action)
     Execute a JDBC data access operation, implemented as callback action working on a JDBC Connection. The stored DataSource is used to provide JDBC connection for the action.
public  ListItemsDataexecute(ResultReader reader)
     Executes SQL queries that should retrieve 1) the total count of items in the list and 2) a range of items from the list Provided ResultReader is used to convert the ResultSet into a List. The stored DataSource is used to provide JDBC connection for the action.
public  ListItemsDataexecute(Class itemClass)
     Executes SQL queries that should retrieve 1) the total count of items in the list and 2) a range of items from the list ListSqlHelper's BeanResultReader is used to convert the ResultSet into a List. The stored DataSource is used to provide JDBC connection for the action.
public  LongexecuteCountSql()
     Executes a SQL query that should retrieve the total count of items in the list. The stored DataSource is used to provide JDBC connection for the action.
public  ListexecuteItemRangeSql(ResultReader reader)
     Executes a SQL query that should retrieve a range of items from the list. Provided ResultReader is used to convert the ResultSet into a List. The stored DataSource is used to provide JDBC connection for the action.
public  ListexecuteItemRangeSql(Class itemClass)
     Executes a SQL query that should retrieve a range of items from the list. ListSqlHelper's BeanResultReader is used to convert the ResultSet into a List. The stored DataSource is used to provide JDBC connection for the action.
public  ConnectionCallbackgetCountSqlCallback()
     Returns the total count query callback.
abstract protected  SqlStatementgetCountSqlStatement()
     Returns the total count SQL query String and parameters.
public  StringgetDatabaseFields()
     Returns the database fields list seperated by commas, which can be used in "SELECT" clause.
public  StringgetDatabaseFilter()
     Returns the filter database condition, which can be used in "WHERE" clause.
public  ListgetDatabaseFilterParams()
     Returns the List of parameters that should be set in the PreparedStatement that belong to the filter database conditions.
public  StringgetDatabaseFilterWith(String prefix, String suffix)
     Returns the database filter query with prefix added before and suffix after it if the query is not empty.
Parameters:
  prefix - Prefix added before the expression.
Parameters:
  suffix - Suffix added after the expression.
public  StringgetDatabaseOrder()
     Returns the order database representation, which can be used in "ORDER BY" clause.
public  ListgetDatabaseOrderParams()
     Returns the List of parameters that should be set in the PreparedStatement that belong to the order database representation.
public  StringgetDatabaseOrderWith(String prefix, String suffix)
     Returns the database order query with prefix added before and suffix after it if the query is not empty.
Parameters:
  prefix - Prefix added before the expression.
Parameters:
  suffix - Suffix added after the expression.
public  FieldsgetFields()
    
protected  SqlExpressiongetFieldsSqlExpression()
     Returns the fields SqlExpression, which can be used in "SELECT" clause.
protected  SqlExpressiongetFilterSqlExpression()
     Returns the filter SqlExpression, which can be used in "WHERE" clause.
public  ConnectionCallbackgetItemRangeSqlCallback(ResultReader reader)
     Returns the item range query callback.
public  ConnectionCallbackgetListItemsDataCallback(ResultReader reader)
     Returns the total count and item ragne queries callback.
public  NamingStrategygetNamingStrategy()
    
protected  SqlExpressiongetOrderSqlExpression()
     Returns the order SqlExpression, which can be used in "ORDER BY" clause.
abstract protected  SqlStatementgetRangeSqlStatement()
     Returns the itme range SQL query String and parameters.
public  ResultSetColumnReadergetResultSetColumnReader()
    
public  ValueConvertergetValueConverter()
    
protected  voidinit()
    
abstract public  voidsetCountSqlQuery(String countSqlQuery)
     Sets the SQL query used to count the items in the database.
public  voidsetDataSource(DataSource ds)
     Stores the DataSource.
public  voidsetFields(Fields fields)
    
public  voidsetFilterExpression(Expression filterExpr)
     Sets the filter expression saving it for later automatic SQL query creation.
public  voidsetItemRangeCount(Long itemRangeCount)
     Sets the count of items in the range.
public  voidsetItemRangeStart(Long itemRangeStart)
     Sets the (0-based) starting index of the item range.
public  voidsetListQuery(ListQuery query)
     Sets the starting index and count of items in the range and filtering and ordering expressions.
public  voidsetNamingStrategy(NamingStrategy namingStrategy)
    
public  voidsetOrderExpression(ComparatorExpression orderExpr)
     Sets the order expression saving it for later automatic SQL query creation.
public  voidsetResultSetColumnReader(ResultSetColumnReader resultSetColumnReader)
    
public  voidsetSimpleSqlQuery(String fromSql)
     Sets the SQL query (with arguments) that will be used to retrieve the item range from the list and count the items.

ListQuery filter and order conditions are used automatically.

To use additional custom filter (and order) conditions, use BaseListSqlHelper.setSimpleSqlQuery(String,String,Object[]) or BaseListSqlHelper.setSimpleSqlQuery(String,String,Object[],String,Object[]) method.

public  voidsetSimpleSqlQuery(String fromSql, String customWhereSql, Object[] customWhereArgs)
     Sets the SQL query (with arguments) that will be used to retrieve the item range from the list and count the items.

ListQuery filter and order conditions are used automatically and they must not be added to this metohd's arguments.

public  voidsetSimpleSqlQuery(String fromSql, String customWhereSql, Object[] customWhereArgs, String customOrderbySql, Object[] customOrderbyArgs)
     Sets the SQL query (with arguments) that will be used to retrieve the item range from the list and count the items.

ListQuery filter and order conditions are used automatically and they must not be added to this metohd's arguments.

abstract public  voidsetSqlQuery(String sqlQuery)
     Sets the SQL query that will be used to retrieve the item range from the list and count the items.
public  voidsetValueConverter(ValueConverter valueConverter)
    

Field Detail
DEFAULT_RANGE_START
final protected static Long DEFAULT_RANGE_START(Code)



ds
protected DataSource ds(Code)



fields
protected Fields fields(Code)



filterExpr
protected Expression filterExpr(Code)



filterSqlExpr
protected SqlExpression filterSqlExpr(Code)



itemRangeCount
protected Long itemRangeCount(Code)



itemRangeStart
protected Long itemRangeStart(Code)



namingStrategy
protected NamingStrategy namingStrategy(Code)



orderExpr
protected ComparatorExpression orderExpr(Code)



orderSqlExpr
protected SqlExpression orderSqlExpr(Code)



resultSetColumnReader
protected ResultSetColumnReader resultSetColumnReader(Code)



valueConverter
protected ValueConverter valueConverter(Code)



variableResolver
protected VariableResolver variableResolver(Code)




Constructor Detail
BaseListSqlHelper
public BaseListSqlHelper()(Code)
Creates ListSqlHelper without initializing any fields.



BaseListSqlHelper
public BaseListSqlHelper(DataSource dataSource)(Code)
Creates ListSqlHelper and provides it with the DataSource.



BaseListSqlHelper
public BaseListSqlHelper(ListQuery query)(Code)
Creates ListSqlHelper initializing the appropriate fields.



BaseListSqlHelper
public BaseListSqlHelper(DataSource dataSource, ListQuery query)(Code)
Creates ListSqlHelper initializing the appropriate fields and providing it with the DataSource.




Method Detail
addNullParam
abstract public void addNullParam(int valueType)(Code)
Adds a NULL PreparedStatement parameter for later setting.

This method should not be used with one of the setSimpleSqlQuery methods.


Parameters:
  valueType - the type of the NULL value.



addStatementParam
abstract public void addStatementParam(Object param)(Code)
Adds a PreparedStatement parameter for later setting.

This method should not be used with one of the setSimpleSqlQuery methods.


Parameters:
  param - a PreparedStatement parameter.



addStatementParams
abstract public void addStatementParams(List params)(Code)
Adds PreparedStatement parameters for later setting.

This method should not be used with one of the setSimpleSqlQuery methods.


Parameters:
  params - PreparedStatement parameters.



createBeanResultReader
public ResultReader createBeanResultReader(Class itemClass)(Code)
Returns Bean ResultSet reader. In most cases, you should not use this method directly, instead using one of the execute methods is recommended.



createExpressionBuilderResolver
protected VariableResolver createExpressionBuilderResolver()(Code)
Creates the VariableResolver for SqlExpressionBuilder that converts Variable names to their Database Field names according to the naming strategy. the VariableResolver for SqlExpressionBuilder that convertsVariable names to their Database Field names according to the naming strategy.



createFilterSqlExpressionBuilder
protected StandardExpressionToSqlExprBuilder createFilterSqlExpressionBuilder()(Code)
Creates new filtering SQL Expression builder.



createOrderSqlExpressionBuilder
protected StandardCompExprToSqlExprBuilder createOrderSqlExpressionBuilder()(Code)
Creates new ordering SQL Expression builder.



createQueryFailedException
protected static RuntimeException createQueryFailedException(String QueryString, List queryParams, SQLException nestedException)(Code)
Returns query failed Exception that contains query String and params.



execute
public Object execute(ConnectionCallback action)(Code)
Execute a JDBC data access operation, implemented as callback action working on a JDBC Connection. The stored DataSource is used to provide JDBC connection for the action. The connection is always closed after the action. This method is used by all other execute methods in ListSqlHelper. To override getting the connection, you have to use one of the ConnectionCallback returning methods and use your own implementation to execute it.
Parameters:
  action - callback object that specifies the action. a result object returned by the action, or null.



execute
public ListItemsData execute(ResultReader reader)(Code)
Executes SQL queries that should retrieve 1) the total count of items in the list and 2) a range of items from the list Provided ResultReader is used to convert the ResultSet into a List. The stored DataSource is used to provide JDBC connection for the action. The connection will be closed automatically.
Parameters:
  reader - ResultSet reader. ListItemsData containing the item range and totalcount.



execute
public ListItemsData execute(Class itemClass)(Code)
Executes SQL queries that should retrieve 1) the total count of items in the list and 2) a range of items from the list ListSqlHelper's BeanResultReader is used to convert the ResultSet into a List. The stored DataSource is used to provide JDBC connection for the action. The connection will be closed automatically.
Parameters:
  itemClass - Bean class. ListItemsData containing the item range and totalcount.



executeCountSql
public Long executeCountSql()(Code)
Executes a SQL query that should retrieve the total count of items in the list. The stored DataSource is used to provide JDBC connection for the action. The connection will be closed automatically. the total count of items in the list.



executeItemRangeSql
public List executeItemRangeSql(ResultReader reader)(Code)
Executes a SQL query that should retrieve a range of items from the list. Provided ResultReader is used to convert the ResultSet into a List. The stored DataSource is used to provide JDBC connection for the action. The connection will be closed automatically.
Parameters:
  reader - ResultSet reader. List containing the item range.



executeItemRangeSql
public List executeItemRangeSql(Class itemClass)(Code)
Executes a SQL query that should retrieve a range of items from the list. ListSqlHelper's BeanResultReader is used to convert the ResultSet into a List. The stored DataSource is used to provide JDBC connection for the action. The connection will be closed automatically.
Parameters:
  itemClass - Bean class. List containing the item range.



getCountSqlCallback
public ConnectionCallback getCountSqlCallback()(Code)
Returns the total count query callback. In most cases, you should not use this method directly, instead using one of the execute methods is recommended.



getCountSqlStatement
abstract protected SqlStatement getCountSqlStatement()(Code)
Returns the total count SQL query String and parameters.



getDatabaseFields
public String getDatabaseFields()(Code)
Returns the database fields list seperated by commas, which can be used in "SELECT" clause. the database fields list seperated by commas, which can be usedin "SELECT" clause.



getDatabaseFilter
public String getDatabaseFilter()(Code)
Returns the filter database condition, which can be used in "WHERE" clause. the filter database condition, which can be used in "WHERE"clause.
See Also:   BaseListSqlHelper.getDatabaseFilterWith(String,String)
See Also:   BaseListSqlHelper.getDatabaseFilterParams()



getDatabaseFilterParams
public List getDatabaseFilterParams()(Code)
Returns the List of parameters that should be set in the PreparedStatement that belong to the filter database conditions. the List of parameters that should be set in thePreparedStatement thatbelong to the filter database conditions.
See Also:   BaseListSqlHelper.getDatabaseFilter()
See Also:   BaseListSqlHelper.getDatabaseFilterWith(String,String)



getDatabaseFilterWith
public String getDatabaseFilterWith(String prefix, String suffix)(Code)
Returns the database filter query with prefix added before and suffix after it if the query is not empty.
Parameters:
  prefix - Prefix added before the expression.
Parameters:
  suffix - Suffix added after the expression. the database filter query with prefix added before and suffix after it if the query is not empty.
See Also:   BaseListSqlHelper.getDatabaseFilter()
See Also:   BaseListSqlHelper.getDatabaseFilterParams()



getDatabaseOrder
public String getDatabaseOrder()(Code)
Returns the order database representation, which can be used in "ORDER BY" clause. the order database representation, which can be used in "ORDER BY" clause.
See Also:   BaseListSqlHelper.getDatabaseOrderWith(String,String)
See Also:   BaseListSqlHelper.getDatabaseOrderParams()



getDatabaseOrderParams
public List getDatabaseOrderParams()(Code)
Returns the List of parameters that should be set in the PreparedStatement that belong to the order database representation. the List of parameters that should be set in thePreparedStatement that belong to the order database representation.
See Also:   BaseListSqlHelper.getDatabaseOrder()
See Also:   BaseListSqlHelper.getDatabaseOrderWith(String,String)



getDatabaseOrderWith
public String getDatabaseOrderWith(String prefix, String suffix)(Code)
Returns the database order query with prefix added before and suffix after it if the query is not empty.
Parameters:
  prefix - Prefix added before the expression.
Parameters:
  suffix - Suffix added after the expression. the database order query with prefix added before and suffix after it if the query is not empty.
See Also:   BaseListSqlHelper.getDatabaseOrder()
See Also:   BaseListSqlHelper.getDatabaseOrderParams()



getFields
public Fields getFields()(Code)



getFieldsSqlExpression
protected SqlExpression getFieldsSqlExpression()(Code)
Returns the fields SqlExpression, which can be used in "SELECT" clause. the fields SqlExpression, which can be used in"SELECT" clause.



getFilterSqlExpression
protected SqlExpression getFilterSqlExpression()(Code)
Returns the filter SqlExpression, which can be used in "WHERE" clause. the filter SqlExpression, which can be used in"WHERE" clause.



getItemRangeSqlCallback
public ConnectionCallback getItemRangeSqlCallback(ResultReader reader)(Code)
Returns the item range query callback. In most cases, you should not use this method directly, instead using one of the execute methods is recommended.



getListItemsDataCallback
public ConnectionCallback getListItemsDataCallback(ResultReader reader)(Code)
Returns the total count and item ragne queries callback. In most cases, you should not use this method directly, instead using one of the execute methods is recommended.



getNamingStrategy
public NamingStrategy getNamingStrategy()(Code)



getOrderSqlExpression
protected SqlExpression getOrderSqlExpression()(Code)
Returns the order SqlExpression, which can be used in "ORDER BY" clause. the order SqlExpression, which can be used in"ORDER BY" clause.



getRangeSqlStatement
abstract protected SqlStatement getRangeSqlStatement()(Code)
Returns the itme range SQL query String and parameters.



getResultSetColumnReader
public ResultSetColumnReader getResultSetColumnReader()(Code)



getValueConverter
public ValueConverter getValueConverter()(Code)



init
protected void init()(Code)



setCountSqlQuery
abstract public void setCountSqlQuery(String countSqlQuery)(Code)
Sets the SQL query used to count the items in the database. SQL query must start with SELECT.

By default, total items count and items range queries are constructed automatically based on the original query. This method should only be used, if it can considerably boost the perfomacne of count query.


Parameters:
  countSqlQuery - the SQL query used to count the items in the database.



setDataSource
public void setDataSource(DataSource ds)(Code)
Stores the DataSource.



setFields
public void setFields(Fields fields)(Code)



setFilterExpression
public void setFilterExpression(Expression filterExpr)(Code)
Sets the filter expression saving it for later automatic SQL query creation.
See Also:   BaseListSqlHelper.getDatabaseFilter()
See Also:   BaseListSqlHelper.getDatabaseFilterWith(String,String)
See Also:   BaseListSqlHelper.getDatabaseFilterParams()



setItemRangeCount
public void setItemRangeCount(Long itemRangeCount)(Code)
Sets the count of items in the range.



setItemRangeStart
public void setItemRangeStart(Long itemRangeStart)(Code)
Sets the (0-based) starting index of the item range.



setListQuery
public void setListQuery(ListQuery query)(Code)
Sets the starting index and count of items in the range and filtering and ordering expressions.



setNamingStrategy
public void setNamingStrategy(NamingStrategy namingStrategy)(Code)



setOrderExpression
public void setOrderExpression(ComparatorExpression orderExpr)(Code)
Sets the order expression saving it for later automatic SQL query creation.
See Also:   BaseListSqlHelper.getDatabaseOrder()
See Also:   BaseListSqlHelper.getDatabaseOrderWith(String,String)
See Also:   BaseListSqlHelper.getDatabaseOrderParams()



setResultSetColumnReader
public void setResultSetColumnReader(ResultSetColumnReader resultSetColumnReader)(Code)



setSimpleSqlQuery
public void setSimpleSqlQuery(String fromSql)(Code)
Sets the SQL query (with arguments) that will be used to retrieve the item range from the list and count the items.

ListQuery filter and order conditions are used automatically.

To use additional custom filter (and order) conditions, use BaseListSqlHelper.setSimpleSqlQuery(String,String,Object[]) or BaseListSqlHelper.setSimpleSqlQuery(String,String,Object[],String,Object[]) method. To use more complex query, use BaseListSqlHelper.setSqlQuery(String) method.

The constrcuted SQL query format is following (LQ = ListQuery):
SELECT (fromSql) [WHERE (LQ filter conditions)] [ORDER BY (LQ order conditions)]

Query arguments are automatically added in the appropriate order.
Parameters:
  fromSql - FROM clause String.



setSimpleSqlQuery
public void setSimpleSqlQuery(String fromSql, String customWhereSql, Object[] customWhereArgs)(Code)
Sets the SQL query (with arguments) that will be used to retrieve the item range from the list and count the items.

ListQuery filter and order conditions are used automatically and they must not be added to this metohd's arguments. This method's Where arguments are only for additional conditions that are not contained in ListQuery already.

In simpler cases, use BaseListSqlHelper.setSimpleSqlQuery(String) method. To use also custom order by conditions, use BaseListSqlHelper.setSimpleSqlQuery(String,String,Object[],String,Object[]) method. To use more complex query, use BaseListSqlHelper.setSqlQuery(String) method.

The constrcuted SQL query format is following (LQ = ListQuery):
SELECT (fromSql) [WHERE (customWhereSql) AND (LQ filter conditions)] [ORDER BY (customOrderbySql), (LQ order conditions)]

Query arguments are automatically added in the appropriate order.
Parameters:
  fromSql - FROM clause String.
Parameters:
  customWhereSql - custom WHERE clause String.
Parameters:
  customWhereArgs - custom WHERE clause arguments.



setSimpleSqlQuery
public void setSimpleSqlQuery(String fromSql, String customWhereSql, Object[] customWhereArgs, String customOrderbySql, Object[] customOrderbyArgs)(Code)
Sets the SQL query (with arguments) that will be used to retrieve the item range from the list and count the items.

ListQuery filter and order conditions are used automatically and they must not be added to this metohd's arguments. This method's Where and Order by arguments are only for additional conditions that are not contained in ListQuery already.

In simpler cases, use BaseListSqlHelper.setSimpleSqlQuery(String) or BaseListSqlHelper.setSimpleSqlQuery(String,String,Object[]) method. To use more complex query, use BaseListSqlHelper.setSqlQuery(String) method.

The constrcuted SQL query format is following (LQ = ListQuery):
SELECT (fromSql) [WHERE (customWhereSql) AND (LQ filter conditions)] [ORDER BY (customOrderbySql), (LQ order conditions)]

Query arguments are automatically added in the appropriate order.
Parameters:
  fromSql - FROM clause String.
Parameters:
  customWhereSql - custom WHERE clause String.
Parameters:
  customWhereArgs - custom WHERE clause arguments.
Parameters:
  customOrderbySql - custom ORDER BY clause String.
Parameters:
  customOrderbyArgs - custom ORDER BY clause arguments.



setSqlQuery
abstract public void setSqlQuery(String sqlQuery)(Code)
Sets the SQL query that will be used to retrieve the item range from the list and count the items. SQL query must start with SELECT. All query arguments must be added additionally.

ListQuery filter and order conditions are not added automatically. To add them, use getDatabaseFilter* and getDatabaseOrder* methods.

For simpler cases, use one of the setSimpleSqlQuery methods instead.


Parameters:
  sqlQuery - the SQL query that will be used to retrieve the item rangefrom the list and count the items.



setValueConverter
public void setValueConverter(ValueConverter valueConverter)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.