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;
010:
011: import com.completex.objective.components.persistency.core.DatabasePolicy;
012:
013: /**
014: * @author Gennady Krizhevsky
015: */
016: public interface Call extends BasicQuery, ResultableQueryManager,
017: Cloneable {
018:
019: /**
020: * Compiled call which makes it immutable
021: *
022: * @param databasePolicy
023: * @return compiled call (itself)
024: */
025: Call compile(DatabasePolicy databasePolicy);
026:
027: /**
028: * Compiled call which makes it immutable
029: *
030: * @return compiled call (itself)
031: * @throws OdalRuntimePersistencyException
032: * if DatabasePolicy is not set but is required for compillation
033: */
034: Call compile();
035:
036: /**
037: * Returns true if query is copiled
038: *
039: * @return true if query is copiled
040: */
041: boolean isCompiled();
042:
043: /**
044: * Returns call body which is internal part of call SQL:
045: * "sp( ?, ? )", for instance.
046: *
047: * @return call body body which is internal part of call SQL:
048: * "sp( ?, ? )", for instance.
049: */
050: String getCallBody();
051:
052: /**
053: * Sets call body which is internal part of call SQL:
054: * "sp( ?, ? )", for instance.
055: *
056: * @param callBody internal part of call SQL:
057: * "sp( ?, ? )", for instance.
058: */
059: void setCallBody(String callBody);
060:
061: /**
062: * Returns true if this call represents database function
063: *
064: * @return true if this call represents database function
065: */
066: boolean isFunction();
067:
068: /**
069: * Sets the flag to indicate if this call represents database function
070: *
071: * @param function indicates if this call represents database function
072: */
073: void setFunction(boolean function);
074:
075: /**
076: * Returns CallParameters set for this call
077: *
078: * @return Parameters CallParameters set for this call
079: */
080: CallParameters getParameters();
081:
082: /**
083: * Set call parameters
084: *
085: * @param parameters
086: * @return itself
087: */
088: Call setParameters(CallParameters parameters);
089:
090: /**
091: * Adds call parameter of <code>ColumnType<code/> type
092: *
093: * @param type
094: * @param parameter
095: * @param mode one of CallParameter.Mode types (in, out, inout)
096: * @return itself
097: */
098: Call addParameter(ColumnType type, Object parameter,
099: CallParameter.Mode mode);
100:
101: /**
102: * Adds call IN parameter of <code>ColumnType<code/> type
103: *
104: * @param type
105: * @param value
106: * @return itself
107: */
108: Call addInParameter(ColumnType type, Object value);
109:
110: /**
111: * Adds call OUT parameter of <code>ColumnType<code/> type
112: *
113: * @param type
114: * @param value
115: * @return itself
116: */
117: Call addOutParameter(ColumnType type, Object value);
118:
119: /**
120: * Adds call INOUT parameter of <code>ColumnType<code/> type
121: *
122: * @param type
123: * @param value
124: * @return itself
125: */
126: Call addInOutParameter(ColumnType type, Object value);
127:
128: /**
129: * Adds Ref Cursor parameter of <code>ColumnType<code/> type
130: *
131: * @return itself
132: */
133: Call addRefCursorParameter();
134:
135: /**
136: * Add call parameter of type that will be determined by Persistency
137: *
138: * @param parameter
139: * @return itself
140: */
141: Call addParameter(CallParameter parameter);
142:
143: Object toKey();
144:
145: /**
146: * Returns deep copy of this call
147: *
148: * @return deep copy of this call
149: */
150: Object clone();
151:
152: }
|