01: package org.apache.ojb.broker.accesslayer;
02:
03: /* Copyright 2002-2005 The Apache Software Foundation
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: import org.apache.ojb.broker.PersistenceBrokerSQLException;
19:
20: import java.sql.PreparedStatement;
21: import java.sql.SQLException;
22: import java.sql.Statement;
23: import java.sql.Connection;
24:
25: /**
26: * A class that implements this interface serves as a cache for
27: * <code>java.sql.Statements<code> used for persistence operations
28: * on a given class.
29: * @author brj
30: * @author <a href="mailto:rburt3@mchsi.com">Randall Burt</a>
31: * @version $Id: StatementsForClassIF.java,v 1.10.2.2 2005/06/04 14:13:43 arminw Exp $
32: */
33:
34: public interface StatementsForClassIF {
35: /**
36: * Returns the DELETE Statement used for clazz.
37: * @return java.sql.PreparedStatement
38: */
39: PreparedStatement getDeleteStmt(Connection con) throws SQLException;
40:
41: /**
42: * Returns a generic unprepared Statement used for clazz.
43: * Never use this method for UPDATE/INSERT/DELETE if you want to use the batch mode.
44: * @return java.sql.Statement
45: */
46: Statement getGenericStmt(Connection con, boolean scrollable)
47: throws PersistenceBrokerSQLException;
48:
49: /**
50: * Returns the INSERT Statement used for clazz.
51: * @return java.sql.PreparedStatement
52: */
53:
54: PreparedStatement getInsertStmt(Connection con) throws SQLException;
55:
56: /**
57: * Returns a prepared Statement used for clazz.
58: * @return java.sql.Statement
59: */
60: PreparedStatement getPreparedStmt(Connection con, String sql,
61: boolean scrollable, int explicitFetchSizeHint,
62: boolean callableStmt) throws PersistenceBrokerSQLException;
63:
64: /**
65: * Returns the SELECT Statement used for clazz.
66: * @return java.sql.PreparedStatement
67: */
68: PreparedStatement getSelectByPKStmt(Connection con)
69: throws SQLException;
70:
71: /**
72: * Returns the UPDATE Statement used for clazz.
73: * @return java.sql.PreparedStatement
74: */
75: PreparedStatement getUpdateStmt(Connection con) throws SQLException;
76: }
|