Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

nectar.data
Class DataAdapterService  view DataAdapterService download DataAdapterService.java

java.lang.Object
  extended bynectar.Service
      extended bynectar.data.DataAdapterService

public abstract class DataAdapterService
extends nectar.Service

The DataAdapterService allows access to the DataSource configured in the struts_config.xml file.


Field Summary
 
Fields inherited from class nectar.Service
configuration
 
Constructor Summary
DataAdapterService()
           
 
Method Summary
abstract  ConnectionHandle beginTransaction()
          Signal the beggining of a Transaction.
abstract  void commitTransaction(ConnectionHandle ch)
           
abstract  void delete(ConnectionHandle ch, Delete delete)
           
abstract  void delete(Delete delete)
           
 java.util.HashMap getFieldsById(java.util.Collection fields, java.util.Collection tables, java.lang.Long project, java.lang.Long id)
          Performs a query, retrieving the given fields from the given tables for the given record id and returns a [field] => [(Object) value] HashMap.
 java.util.List getFieldsByIds(java.util.Collection fields, java.util.Collection tables, java.util.Collection ids)
           
 nectar.record.IdTree getIdTree(Query q, nectar.record.IdTree tree, int depth)
          Fetches the ID numbers of the children of the root record defined in the given IdTree.
 void initService()
          Initialize this Service.
abstract  void insert(ConnectionHandle ch, Insert i)
           
abstract  void insert(ConnectionHandle ch, Insert i, boolean returnLastInsertId)
           
abstract  void insert(Insert i)
           
 void killService()
          Shutdown this Service.
abstract  java.util.List readMultipleFieldMultipleRow(Query q)
          Perfoms the query defined by the Query parameter Object, and returns the results as a List of [field] => [(Object) value] HashMap's.
abstract  java.util.HashMap readMultipleFieldSingleRow(Query q)
          Perfoms the query defined by the Query parameter Object, and returns the results as a [field] => [(Object) value] HashMap.
abstract  java.util.List readSingleFieldMultipleRow(Query q)
          Perfoms the query defined by the Query parameter Object, and returns the results as a List of [(Object) value]'s.
abstract  java.lang.Object readSingleFieldSingleRow(Query q)
          Perfoms the query defined by the Query parameter Object, and returns the results as the [(Object) value].
abstract  void rollbackTransaction(ConnectionHandle cd)
           
abstract  void update(ConnectionHandle ch, Update update)
           
abstract  void update(Update update)
           
 
Methods inherited from class nectar.Service
declareDependancy, getServiceName, killDependants, setConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataAdapterService

public DataAdapterService()
Method Detail

beginTransaction

public abstract ConnectionHandle beginTransaction()
                                           throws DataException
Signal the beggining of a Transaction. The returned ConnectionHandle holds an active Connection to the DataSource, and will buffer data updates sent to the DataAdapter until commitTransaction is called.

You MUST absolutely liberate this connection with commitTransaction or rollbackTransaction, since the ConnectionHandle reserves a DataSource connection for exclusive use.


commitTransaction

public abstract void commitTransaction(ConnectionHandle ch)
                                throws DataException

rollbackTransaction

public abstract void rollbackTransaction(ConnectionHandle cd)
                                  throws DataException

readSingleFieldSingleRow

public abstract java.lang.Object readSingleFieldSingleRow(Query q)
                                                   throws DataException
Perfoms the query defined by the Query parameter Object, and returns the results as the [(Object) value].


readMultipleFieldSingleRow

public abstract java.util.HashMap readMultipleFieldSingleRow(Query q)
                                                      throws DataException
Perfoms the query defined by the Query parameter Object, and returns the results as a [field] => [(Object) value] HashMap.


readMultipleFieldMultipleRow

public abstract java.util.List readMultipleFieldMultipleRow(Query q)
                                                     throws DataException
Perfoms the query defined by the Query parameter Object, and returns the results as a List of [field] => [(Object) value] HashMap's.


readSingleFieldMultipleRow

public abstract java.util.List readSingleFieldMultipleRow(Query q)
                                                   throws DataException
Perfoms the query defined by the Query parameter Object, and returns the results as a List of [(Object) value]'s.


getFieldsById

public java.util.HashMap getFieldsById(java.util.Collection fields,
                                       java.util.Collection tables,
                                       java.lang.Long project,
                                       java.lang.Long id)
                                throws DataException
Performs a query, retrieving the given fields from the given tables for the given record id and returns a [field] => [(Object) value] HashMap.


getFieldsByIds

public java.util.List getFieldsByIds(java.util.Collection fields,
                                     java.util.Collection tables,
                                     java.util.Collection ids)
                              throws DataException

getIdTree

public nectar.record.IdTree getIdTree(Query q,
                                      nectar.record.IdTree tree,
                                      int depth)
                               throws DataException
Fetches the ID numbers of the children of the root record defined in the given IdTree. The ID numbers may refer to any record type -- the restrictions are to be defined in the Query parameter.

The root ID defined in the IdTree instance may be null, in which case the top level records of the tree will be retrieved, and the ID property at the top of the resulting IdTree will be null.

If the root ID defined in the IdTree instance is not null, it's ID number will appear as the ID property in the top level of the tree.

depth is the number of recursions to perform into the tree, so the tree depth.


insert

public abstract void insert(Insert i)
                     throws DataException

insert

public abstract void insert(ConnectionHandle ch,
                            Insert i)
                     throws DataException

insert

public abstract void insert(ConnectionHandle ch,
                            Insert i,
                            boolean returnLastInsertId)
                     throws DataException

update

public abstract void update(Update update)
                     throws DataException

update

public abstract void update(ConnectionHandle ch,
                            Update update)
                     throws DataException

delete

public abstract void delete(ConnectionHandle ch,
                            Delete delete)
                     throws DataException

delete

public abstract void delete(Delete delete)
                     throws DataException

initService

public void initService()
                 throws nectar.configuration.ConfigurationException,
                        nectar.ServiceException
Description copied from class: nectar.Service
Initialize this Service. This method must be overridden by Service implementations and should contain dependancy declarations, and other initializing procedures. Upon return of the function, the Service should be ready to do it's job.


killService

public void killService()
Description copied from class: nectar.Service
Shutdown this Service. This method must be overridden by Service implementations and should contain a call to killDependants(), and other shutdown procedures.