org.opensubsystems.patterns.listdata.persist.db.impl
Class ListDatabaseFactoryImpl

java.lang.Object
  extended by org.opensubsystems.core.persist.db.DatabaseFactoryImpl
      extended by org.opensubsystems.patterns.listdata.persist.db.impl.ListDatabaseFactoryImpl
All Implemented Interfaces:
org.opensubsystems.core.persist.DataFactory, org.opensubsystems.core.persist.db.DatabaseFactory, ListDatabaseFactory, ListFactory

public abstract class ListDatabaseFactoryImpl
extends org.opensubsystems.core.persist.db.DatabaseFactoryImpl
implements ListFactory, ListDatabaseFactory

Base class for all database factory mainly collecting reusable and useful code.

Version:
$Id: ListDatabaseFactoryImpl.java,v 1.4 2007/02/01 07:24:13 bastafidli Exp $
Author:
Miroslav Halas
Code reviewer:
Miroslav Halas
Code reviewed:
Initial revision

Field Summary
protected  int[] m_arrOrderColumnCodes
          Codes for columns to order the list of data object by, null if no sorting should be done.
protected  java.lang.String[] m_arrOrderDirections
          Directions how to order the list of data objects.
protected  int[] m_arrShowColumnCodes
          Array of attributes to retrieve for each data object.
protected  ListDatabaseSchema m_listSchema
          Schema that can be used to execute database dependent list operations.
 
Fields inherited from class org.opensubsystems.core.persist.db.DatabaseFactoryImpl
m_connectionFactory, m_iConcurrencySelectListResultSet, m_iDataType, m_iTypeSelectListResultSet, m_transactionFactory
 
Constructor Summary
ListDatabaseFactoryImpl(int iDataType, int[] arrOrderColumnCodes, java.lang.String[] arrOrderDirections, int[] arrShowColumnCodes, ListDatabaseSchema listSchema)
          Constructor.
 
Method Summary
 java.util.List get(ListOptions options)
          Get list of data objects specified by the list options.
 ListDefinition getDefaultListDefinition()
          Get the default list definition, which will be used to retrieve the initial list of data objects
 ListDatabaseSchema getListDatabaseSchema()
          Get the list database schema used by this factory.
 
Methods inherited from class org.opensubsystems.core.persist.db.DatabaseFactoryImpl
getConcurrencySelectListResultSet, getDataType, getTypeSelectListResultSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensubsystems.core.persist.DataFactory
get, getDataType
 
Methods inherited from interface org.opensubsystems.patterns.listdata.persist.db.ListDatabaseFactory
load
 
Methods inherited from interface org.opensubsystems.core.persist.db.DatabaseFactory
load
 

Field Detail

m_arrOrderColumnCodes

protected int[] m_arrOrderColumnCodes
Codes for columns to order the list of data object by, null if no sorting should be done.


m_arrOrderDirections

protected java.lang.String[] m_arrOrderDirections
Directions how to order the list of data objects. See ListDefinition.ORDER_XXX constants.


m_arrShowColumnCodes

protected int[] m_arrShowColumnCodes
Array of attributes to retrieve for each data object. Each attribute should have assigned unique code that can be used to identify that attribute and column where it is stored.


m_listSchema

protected ListDatabaseSchema m_listSchema
Schema that can be used to execute database dependent list operations.

Constructor Detail

ListDatabaseFactoryImpl

public ListDatabaseFactoryImpl(int iDataType,
                               int[] arrOrderColumnCodes,
                               java.lang.String[] arrOrderDirections,
                               int[] arrShowColumnCodes,
                               ListDatabaseSchema listSchema)
                        throws org.opensubsystems.core.error.OSSException
Constructor.

Parameters:
iDataType - - data type the factory will be used for
arrOrderColumnCodes - - codes for columns to order the list of data object by, null if no sorting should be done.
arrOrderDirections - - directions how to order the list of data objects. See ListDefinition.ORDER_XXX constants.
arrShowColumnCodes - - array of attributes to retrieve for each data object. Each attribute should have assigned unique code that can be used to identify that attribute and column where it is stored.
listSchema - - schema that can be used to execute database dependent list operations.
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
Method Detail

getDefaultListDefinition

public ListDefinition getDefaultListDefinition()
Get the default list definition, which will be used to retrieve the initial list of data objects

Specified by:
getDefaultListDefinition in interface ListFactory
Returns:
ListDefinition - list definition describing what list of data objects to retrieve by default.

get

public java.util.List get(ListOptions options)
                   throws org.opensubsystems.core.error.OSSException
Get list of data objects specified by the list options.

Specified by:
get in interface ListFactory
Parameters:
options - - options specifying what data to retrieve
Returns:
List - list of selected items specified by the list option
Throws:
org.opensubsystems.core.error.OSSException - - error during select

getListDatabaseSchema

public ListDatabaseSchema getListDatabaseSchema()
Get the list database schema used by this factory.

Returns:
ListDatabaseSchema - list database schema used by this factory


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