org.opensubsystems.patterns.listdata.persist.db
Class MySQLListDatabaseUtils

java.lang.Object
  extended by org.opensubsystems.patterns.listdata.persist.db.ListDatabaseUtils
      extended by org.opensubsystems.patterns.listdata.persist.db.MySQLListDatabaseUtils

public class MySQLListDatabaseUtils
extends ListDatabaseUtils

This class is used for common list retrieval and manipulation routines specific for MySQL.

Version:
$Id: MySQLListDatabaseUtils.java,v 1.28 2007/02/01 07:23:41 bastafidli Exp $
Author:
Julo Legeny
Code reviewer:
Miro Halas
Code reviewed:
1.22 2006/03/14 23:56:56 jlegeny

Field Summary
 
Fields inherited from class org.opensubsystems.patterns.listdata.persist.db.ListDatabaseUtils
LIST_INDEX_PREFIX
 
Constructor Summary
MySQLListDatabaseUtils()
          Constructor
 
Method Summary
 java.util.List getObjectList(ListOptions options, java.lang.String query, ListDatabaseFactory factory, ListDatabaseSchema schema)
          Get list of data objects for specified parameters
 java.lang.String getWhereClause(java.lang.String strTableName, int[] arrIds, SimpleRule securityFilter, ListDatabaseSchema schema)
          Get where clause to select specified ids while taking into account specified security filter therefore retrieving only those data objects for which the access is granted.
protected  java.lang.String preprocessSelectQuery(java.lang.String inputQuery, ListOptions options, ListDatabaseSchema schema)
          Method that preprocess query (by adding specific SQL clauses for example LIMIT, ...) to improve performance of selecting items from the list at specific position.
protected  java.lang.String preprocessSelectQueryForCreationDate(java.lang.String inputQuery, ListOptions options, ListDatabaseSchema schema)
          Method that preprocess query (by adding specific SQL clauses after CREATION_DATE sort column) to fix ordering if DBS supports short timestamp value.
 
Methods inherited from class org.opensubsystems.patterns.listdata.persist.db.ListDatabaseUtils
allocateObjectList, convertValueToSQL, getConstructListIndexName, getInstance, getObjectListKeepSelected, getSelectCount, getSelectList, getSQLOperation, getSQLValue, getTotalRecords, getWhereClause, parseCondition, setOptionPositioning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySQLListDatabaseUtils

public MySQLListDatabaseUtils()
Constructor

Method Detail

getWhereClause

public java.lang.String getWhereClause(java.lang.String strTableName,
                                       int[] arrIds,
                                       SimpleRule securityFilter,
                                       ListDatabaseSchema schema)
                                throws org.opensubsystems.core.error.OSSException
Get where clause to select specified ids while taking into account specified security filter therefore retrieving only those data objects for which the access is granted. The returned clause will start with "where".

Overrides:
getWhereClause in class ListDatabaseUtils
Parameters:
strTableName - - name of the table in database
arrIds - - array of Ids which should be selected, may be null when no special IDs should be selected
securityFilter - - rule describing what data can user access
schema - - list database schema implementation capable of providing more info about attributes included in the query
Returns:
String - where query
Throws:
org.opensubsystems.core.error.OSSException - - error during parse

getObjectList

public java.util.List getObjectList(ListOptions options,
                                    java.lang.String query,
                                    ListDatabaseFactory factory,
                                    ListDatabaseSchema schema)
                             throws org.opensubsystems.core.error.OSSException
Get list of data objects for specified parameters

Overrides:
getObjectList in class ListDatabaseUtils
Parameters:
options - - list option describing the list to retrieve
query - - select SQL query
factory - - list factory for specific data object
schema - - list database schema
Returns:
List - list of data objects
Throws:
org.opensubsystems.core.error.OSSException - - an error getting object list

preprocessSelectQuery

protected java.lang.String preprocessSelectQuery(java.lang.String inputQuery,
                                                 ListOptions options,
                                                 ListDatabaseSchema schema)
                                          throws org.opensubsystems.core.error.OSSException
Method that preprocess query (by adding specific SQL clauses for example LIMIT, ...) to improve performance of selecting items from the list at specific position. This method can be overwritten by DB specific method.

Overrides:
preprocessSelectQuery in class ListDatabaseUtils
Parameters:
inputQuery - - query that will be preprocessed
options - - initialized list options that will be used for retrieving begin position, page size, ...
schema - - list database schema
Returns:
String - preprocessed query
Throws:
org.opensubsystems.core.error.OSSException - - error during preprocessing select query

preprocessSelectQueryForCreationDate

protected java.lang.String preprocessSelectQueryForCreationDate(java.lang.String inputQuery,
                                                                ListOptions options,
                                                                ListDatabaseSchema schema)
                                                         throws org.opensubsystems.core.error.OSSException
Method that preprocess query (by adding specific SQL clauses after CREATION_DATE sort column) to fix ordering if DBS supports short timestamp value. This method can be overwritten by DB specific method.

Overrides:
preprocessSelectQueryForCreationDate in class ListDatabaseUtils
Parameters:
inputQuery - - query that will be preprocessed
options - - initialized list options that will be used for retrieving begin position, page size, ...
schema - - list database schema
Returns:
String - preprocessed query
Throws:
org.opensubsystems.core.error.OSSException - - error during preprocessing select query


Copyright © 2003 - 2006 OpenSubsystems s.r.o.