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.model;
042:
043: import java.util.List;
044:
045: import com.sun.sql.framework.exception.BaseException;
046:
047: /**
048: * Defines methods required for a target table representation.
049: *
050: * @author Jonathan Giron
051: * @version $Revision$
052: */
053: public interface TargetTable extends SQLDBTable, SQLConnectableObject {
054:
055: public static final String JOIN_CONDITION = "condition";
056:
057: public static final String FILTER_CONDITION = "filterCondition";
058:
059: /**
060: * get the target table join condition
061: *
062: * @return target table join conidiotn
063: */
064: public SQLCondition getJoinCondition();
065:
066: /**
067: * get join condition text
068: *
069: * @return sql condition
070: */
071: public String getJoinConditionText();
072:
073: /**
074: * get the target table filter condition
075: *
076: * @return target table filter conidiotn
077: */
078: public SQLCondition getFilterCondition();
079:
080: /**
081: * get filter condition text
082: *
083: * @return sql condition
084: */
085: public String getFilterConditionText();
086:
087: /**
088: * get the single join view which is mapped to this target table in case of multiple
089: * source table mapping to this target table.
090: */
091: public SQLJoinView getJoinView();
092:
093: /**
094: * get a list of columns which are mapped by the user
095: *
096: * @return list of mapped columns
097: */
098: public List<TargetColumn> getMappedColumns();
099:
100: /**
101: * Gets the Source Table List
102: *
103: * @return List All source tables
104: * @exception BaseException thrown while getting Source Table List
105: */
106: public List<DBTable> getSourceTableList() throws BaseException;
107:
108: /**
109: * get report group by object
110: *
111: * @return SQLGroupBy
112: */
113: public SQLGroupBy getSQLGroupBy();
114:
115: /**
116: * get the type of statement type for this table
117: *
118: * @return statement type
119: */
120: public int getStatementType();
121:
122: /**
123: * get string representation of statement type
124: *
125: * @return statement type
126: */
127: public String getStrStatementType();
128:
129: /**
130: * get whether to create target table
131: *
132: * @return whether to create target table
133: */
134: public boolean isCreateTargetTable();
135:
136: /**
137: * Indicates whether contents of target table should be truncated before loading new
138: * data.
139: *
140: * @return true if contents should be truncated; false otherwise
141: */
142: public boolean isTruncateBeforeLoad();
143:
144: /**
145: * Indicates whether the fully-qualified form should be used whenever one resolves
146: * this table's name.
147: *
148: * @return true if fully-qualified form should be used, false otherwise
149: */
150: public boolean isUsingFullyQualifiedName();
151:
152: /**
153: * set the target table join condition
154: *
155: * @param cond target table join condition
156: */
157: public void setJoinCondition(SQLCondition cond);
158:
159: /**
160: * set the join condition text
161: *
162: * @param cond sql condition
163: */
164: public void setJoinConditionText(String cond);
165:
166: /**
167: * set the target table filter condition
168: *
169: * @param cond target table filter condition
170: */
171: public void setFilterCondition(SQLCondition cond);
172:
173: /**
174: * set the filter condition text
175: *
176: * @param cond sql condition
177: */
178: public void setFilterConditionText(String cond);
179:
180: /**
181: * set whether to create target table if does not exist
182: *
183: * @param create whether to create target table
184: */
185: public void setCreateTargetTable(boolean create);
186:
187: /**
188: * set group by object
189: *
190: * @param groupBy - SQLGroupBy
191: */
192: public void setSQLGroupBy(SQLGroupBy groupBy);
193:
194: /**
195: * set the type of statement type for this table
196: *
197: * @param sType statement type
198: */
199: public void setStatementType(int sType);
200:
201: public void setBatchSize(int newsize);
202:
203: public void setUsingFullyQualifiedName(boolean usesFullName);
204:
205: /**
206: * set string representation of statement type
207: *
208: * @param stType statement type
209: */
210: public void setStrStatementType(String stType);
211:
212: /**
213: * Sets whether contents of target table should be truncated before loading new data.
214: *
215: * @param flag true if contents should be truncated; false otherwise
216: */
217: public void setTruncateBeforeLoad(boolean flag);
218: }
|