001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041: package org.netbeans.modules.sql.framework.codegen;
042:
043: import java.util.Map;
044: import org.netbeans.modules.sql.framework.model.SQLDBTable;
045: import org.netbeans.modules.sql.framework.model.SQLJoinView;
046: import org.netbeans.modules.sql.framework.model.SourceTable;
047: import org.netbeans.modules.sql.framework.model.TargetTable;
048: import com.sun.sql.framework.exception.BaseException;
049: import com.sun.sql.framework.jdbc.SQLPart;
050: import org.netbeans.modules.sql.framework.model.SQLJoinOperator;
051:
052: /**
053: * Statments provide a single access point to all the suported statements in various DBs.
054: *
055: * @author ritesh Adval
056: * @author Ahimanikya Satapathy
057: * @version $Revision$
058: */
059: public interface Statements {
060:
061: public SQLPart getOnePassSelectStatement(TargetTable targetTable,
062: StatementContext context) throws BaseException;
063:
064: public SQLPart getSelectStatement(SourceTable sourceTable,
065: StatementContext context) throws BaseException;
066:
067: public SQLPart getSelectStatement(TargetTable targetTable,
068: StatementContext context) throws BaseException;
069:
070: public SQLPart getSelectStatement(SQLJoinView joinView,
071: StatementContext context) throws BaseException;
072:
073: public SQLPart getSelectStatement(SQLJoinOperator joinOp,
074: StatementContext context) throws BaseException;
075:
076: public SQLPart getPreparedInsertStatement(SQLDBTable table,
077: StatementContext context) throws BaseException;
078:
079: public SQLPart getStaticInsertStatement(TargetTable targetTable,
080: StatementContext context) throws BaseException;
081:
082: public SQLPart getUpdateStatement(TargetTable targetTable,
083: StatementContext context) throws BaseException;
084:
085: public SQLPart getMergeStatement(TargetTable TargetTable,
086: StatementContext context) throws BaseException;
087:
088: public SQLPart getCreateStatement(SQLDBTable table,
089: StatementContext context) throws BaseException;
090:
091: public SQLPart getDeleteStatement(SQLDBTable table,
092: StatementContext context) throws BaseException;
093:
094: public SQLPart getTruncateStatement(SQLDBTable targetTable,
095: StatementContext context) throws BaseException;
096:
097: public SQLPart getDropStatement(SQLDBTable table,
098: StatementContext context) throws BaseException;
099:
100: public SQLPart getInsertSelectStatement(TargetTable targetTable,
101: StatementContext context) throws BaseException;
102:
103: public SQLPart getRowCountStatement(SQLDBTable table,
104: StatementContext context) throws BaseException;
105:
106: public SQLPart getTableExistsStatement(SQLDBTable table,
107: StatementContext context) throws BaseException;
108:
109: public SQLPart getDefragStatement(SQLDBTable table,
110: StatementContext context) throws BaseException;
111:
112: public SQLPart getInitializationStatements(StatementContext context)
113: throws BaseException;
114:
115: public SQLPart getCreateLogSummaryTableStatement(
116: boolean useMemoryTable) throws BaseException;
117:
118: public SQLPart getDeleteInvalidRowFromSummaryTableStatement(
119: TargetTable table) throws BaseException;
120:
121: public SQLPart getInsertStartDateIntoSummaryTableStatement(
122: TargetTable table, StatementContext context)
123: throws BaseException;
124:
125: public SQLPart getSelectExecutionIdFromSummaryTableStatement(
126: TargetTable table, StatementContext context)
127: throws BaseException;
128:
129: public String getSummaryTableName();
130:
131: public SQLPart getUpdateEndDateInSummaryTableStatement(
132: TargetTable table, StatementContext context)
133: throws BaseException;
134:
135: public SQLPart normalizeSQLForExecution(SQLPart rawSQLPart);
136:
137: // TODO Voilates Statements interface pattern, need to redesign the interfaces.
138: public Map getCorrelatedUpdateStatement(TargetTable targetTable,
139: StatementContext context) throws BaseException;
140: }
|