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 org.netbeans.modules.sql.framework.model.visitors.SQLVisitedObject;
046:
047: /**
048: * Defines methods required for a source table representation.
049: *
050: * @author Jonathan Giron
051: * @version $Revision$
052: */
053: public interface SourceTable extends SQLDBTable, Cloneable, Comparable,
054: SQLVisitedObject {
055:
056: public static final String DATA_VALIDATION_CONDITION = "dataValidationCondition";
057:
058: /** extraction condition tag */
059: public static final String EXTRACTION_CONDITION = "extractionCondition";
060:
061: /**
062: * get the data validation condition.
063: *
064: * @return data validation condition.
065: */
066: public SQLCondition getDataValidationCondition();
067:
068: /**
069: * Gets the validation condition text.
070: *
071: * @param cond condition text
072: */
073: public String getDataValidationConditionText();
074:
075: /**
076: * get the extraction condition
077: *
078: * @return SQLCondition to apply while doing extraction
079: */
080: public SQLCondition getExtractionCondition();
081:
082: /**
083: * get the extraction conidition text
084: *
085: * @return sql condition
086: */
087: public String getExtractionConditionText();
088:
089: /**
090: * get extraction type
091: *
092: * @return extraction type
093: */
094: public String getExtractionType();
095:
096: /**
097: * get temporary table name
098: *
099: * @return temp table name
100: */
101: public String getTemporaryTableName();
102:
103: /**
104: * get report group by object
105: *
106: * @return SQLGroupBy
107: */
108: public SQLGroupBy getSQLGroupBy();
109:
110: /**
111: * Indicates whether the fully-qualified form should be used whenever one resolves
112: * this table's name.
113: *
114: * @return true if fully-qualified form should be used, false otherwise
115: */
116: public boolean isUsingFullyQualifiedName();
117:
118: /**
119: * get whether to Drop Staging table before extraction
120: *
121: * @return whether to drop staging table
122: */
123: public boolean isDropStagingTable();
124:
125: /**
126: * get whether to truncate Staging table before extraction
127: *
128: * @return whether to truncate staging table
129: */
130: public boolean isTruncateStagingTable();
131:
132: /**
133: * check if distinct rows of a column needs to be selected
134: *
135: * @return distinct
136: */
137: public boolean isSelectDistinct();
138:
139: /**
140: * determine whether this table is used in a join view
141: *
142: * @return boolean
143: */
144: public boolean isUsedInJoin();
145:
146: /**
147: * set the data validation condition.
148: *
149: * @param condition data validation condition
150: */
151: public void setDataValidationCondition(SQLCondition condition);
152:
153: /**
154: * Sets the validation condition text.
155: *
156: * @param cond condition text
157: */
158: public void setDataValidationConditionText(String text);
159:
160: /**
161: * Drop staging table before extraction
162: *
163: * @param whether to drop temp table
164: */
165: public void setDropStagingTable(boolean drop);
166:
167: /**
168: * Truncate staging table before extraction
169: *
170: * @param whether to truncate temp table
171: */
172: public void setTruncateStagingTable(boolean truncate);
173:
174: public void setBatchSize(int newsize);
175:
176: public void setUsingFullyQualifiedName(boolean usesFullName);
177:
178: /**
179: * set the extraction condition
180: *
181: * @param cond filter to appy while extraction
182: */
183: public void setExtractionCondition(SQLCondition cond);
184:
185: /**
186: * set the extraction condition text
187: *
188: * @param cond extraction condition text
189: */
190: public void setExtractionConditionText(String cond);
191:
192: /**
193: * set the extraction type
194: *
195: * @param eType extraction type
196: */
197: public void setExtractionType(String eType);
198:
199: /**
200: * set wehether to select distinct rows of a column
201: *
202: * @param distinct distinct
203: */
204: public void setSelectDistinct(boolean distinct);
205:
206: /**
207: * set the temporary table name
208: *
209: * @param tName temp table name
210: */
211: public void setTemporaryTableName(String tName);
212:
213: /**
214: * set whether this table is used in join view
215: *
216: * @param used boolean
217: */
218: public void setUsedInJoin(boolean used);
219:
220: /**
221: * set group by object
222: *
223: * @param groupBy - SQLGroupBy
224: */
225: public void setSQLGroupBy(SQLGroupBy groupBy);
226:
227: /**
228: * do source table validation
229: *
230: * @return list of validation infos
231: */
232: public List validate();
233: }
|