001: /**
002: * Objective Database Abstraction Layer (ODAL)
003: * Copyright (c) 2004, The ODAL Development Group
004: * All rights reserved.
005: * For definition of the ODAL Development Group please refer to LICENCE.txt file
006: *
007: * Distributable under LGPL license.
008: * See terms of license at gnu.org.
009: */package com.completex.objective.components.persistency.core;
010:
011: import com.completex.objective.components.persistency.AbstractParameters;
012: import com.completex.objective.components.persistency.Call;
013: import com.completex.objective.components.persistency.LifeCycleController;
014: import com.completex.objective.components.persistency.ResultableQueryManager;
015: import com.completex.objective.components.persistency.core.impl.query.QueryContextImpl;
016: import com.completex.objective.components.persistency.core.impl.query.QueryContext;
017: import com.completex.objective.components.persistency.transact.Transaction;
018: import com.completex.objective.components.persistency.type.MultipartCollection;
019:
020: import java.sql.CallableStatement;
021: import java.sql.PreparedStatement;
022: import java.sql.SQLException;
023: import java.util.Collection;
024:
025: /**
026: * @author Gennady Krizhevsky
027: */
028: public interface ResultSetExecutorManager {
029:
030: /**
031: * Retrieves only the 1st result set if there are multiple ones.
032: * Should be used for queries only as opposed to calls
033: *
034: * @param transaction
035: * @param statement
036: * @param query
037: * @param resultSetCtl
038: * @param controller
039: * @param queryContext
040: * @return Collection of persistent objects
041: * @throws SQLException
042: */
043: Collection executeSingleRsQuery(Transaction transaction,
044: PreparedStatement statement, ResultableQueryManager query,
045: ResultSetCtl resultSetCtl, LifeCycleController controller,
046: QueryContext queryContext) throws SQLException;
047:
048: /**
049: * Retrieves only the 1st result set if there are multiple ones.
050: * Should be used for calls only as opposed to queries
051: *
052: * @param transaction
053: * @param statement
054: * @param query
055: * @param resultSetCtl
056: * @param controller
057: * @return Collection of persistent objects
058: * @throws SQLException
059: */
060: Collection executeSingleRsCall(Transaction transaction,
061: CallableStatement statement, Call query,
062: ResultSetCtl resultSetCtl, LifeCycleController controller)
063: throws SQLException;
064:
065: /**
066: * Retrieves all the result sets if there are multiple ones.
067: * Should be used for calls only as opposed to queries
068: *
069: * @param transaction
070: * @param statement
071: * @param query
072: * @param resultSetCtl
073: * @param controller
074: * @return MultipartCollection of persistent objects
075: * @throws SQLException
076: */
077: MultipartCollection executeMultiRsCall(Transaction transaction,
078: CallableStatement statement, Call query,
079: ResultSetCtl resultSetCtl, LifeCycleController controller)
080: throws SQLException;
081:
082: /**
083: * Enables to run paginated queries. It can be run repeatedly bringing new pages.
084: * The last collection returned will be of 0 length.
085: * Should be used for queries only as opposed to calls
086: *
087: * @param transaction
088: * @param query
089: * @param resultSetCtl
090: * @param controller
091: * @param queryContext
092: * @return Collection
093: * @throws SQLException
094: */
095: Collection executeQueryFetch(Transaction transaction,
096: ResultableQueryManager query, ResultSetCtl resultSetCtl,
097: LifeCycleController controller, QueryContext queryContext)
098: throws SQLException;
099:
100: /**
101: * Enables to run paginated queries. It can be run repeatedly bringing new pages.
102: * The last collection returned will be of 0 length.
103: * Should be used for calls only as opposed to queries
104: *
105: * @param transaction
106: * @param query
107: * @param resultSetCtl
108: * @param controller
109: * @return Collection
110: * @throws SQLException
111: */
112: Collection executeCallFetch(Transaction transaction,
113: ResultableQueryManager query, ResultSetCtl resultSetCtl,
114: LifeCycleController controller) throws SQLException;
115:
116: /**
117: * Creates an instance of ResultSetIterator out of statement
118: *
119: * @param statement
120: * @param parameters
121: * @return ResultSetIterator
122: * @throws SQLException
123: */
124: ResultSetIterator resultSetIterator(PreparedStatement statement,
125: AbstractParameters parameters) throws SQLException;
126: }
|