001: /*
002: * The contents of this file are subject to the terms of the Common Development
003: * and Distribution License (the License). You may not use this file except in
004: * compliance with the License.
005: *
006: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007: * or http://www.netbeans.org/cddl.txt.
008: *
009: * When distributing Covered Code, include this CDDL Header Notice in each file
010: * and include the License file at http://www.netbeans.org/cddl.txt.
011: * If applicable, add the following below the CDDL Header, with the fields
012: * enclosed by brackets [] replaced by your own identifying information:
013: * "Portions Copyrighted [year] [name of copyright owner]"
014: *
015: * The Original Software is NetBeans. The Initial Developer of the Original
016: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017: * Microsystems, Inc. All Rights Reserved.
018: */
019:
020: /*
021: *
022: * Copyright 2005 Sun Microsystems, Inc.
023: *
024: * Licensed under the Apache License, Version 2.0 (the "License");
025: * you may not use this file except in compliance with the License.
026: * You may obtain a copy of the License at
027: *
028: * http://www.apache.org/licenses/LICENSE-2.0
029: *
030: * Unless required by applicable law or agreed to in writing, software
031: * distributed under the License is distributed on an "AS IS" BASIS,
032: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
033: * See the License for the specific language governing permissions and
034: * limitations under the License.
035: *
036: */
037:
038: /**
039: * This class is required since the OTD seed is generated as Procedure1, Procedure2
040: * and inside WSDLGenerator there is no way of distinguishing between PreparedStatement and stored procedure DBObjects.
041: * When adding the objects inside WSDLGenerator, specific types are added and later checked for.
042: */package org.netbeans.modules.jdbcwizard.builder.dbmodel.impl;
043:
044: import org.netbeans.modules.jdbcwizard.builder.dbmodel.DBObject;
045: import java.util.ArrayList;
046: import java.util.List;
047:
048: import java.util.ResourceBundle;
049: import org.openide.util.NbBundle;
050:
051: public class DBProcObject extends DBObjectImpl {
052:
053: private ArrayList parameters = null;
054:
055: private int numParameters = 0;
056:
057: // added by anupam
058: private ArrayList procResultSetDesc = null;
059:
060: private int numResultSets = 0;
061:
062: public static final String OTDSEED_RESULTSETID_PATTERN = "Procedure{0}$ResultSets{1}";
063:
064: public static final String OTDSEED_PROCRSCOLID_PATTERN = "Procedure{0}$ResultSets{1}$Column_{2}";
065:
066: // added till here
067:
068: public static final String OTDSEED_PROCID_PATTERN = "Procedure{0}";
069:
070: public static final String OTDSEED_PROCPARAMID_PATTERN = "Procedure{0}Param{1}";
071:
072: /* No-arg constructor; initializes Collections-related member variables. */
073: public DBProcObject() {
074: this .parameters = new ArrayList();
075: this .procResultSetDesc = new ArrayList();
076: }
077:
078: /**
079: * Creates a new instance of DBTableImpl, cloning the contents of the given DBTable
080: * implementation instance.
081: *
082: * @param src DBTable instance to be cloned
083: */
084: public DBProcObject(final DBObject src) {
085: this ();
086: if (src == null) {
087: final ResourceBundle cMessages = NbBundle
088: .getBundle(DBProcObject.class);
089: throw new IllegalArgumentException(cMessages
090: .getString("ERROR_NULL_DBTABLE")
091: + "ERROR_NULL_DBTABLE");// NO
092: // i18n
093: }
094:
095: super .copyFrom(src);
096: }
097:
098: public DBProcObject(final String objectName, final String schema,
099: final String catalog) {
100: super (objectName, schema, catalog);
101: }
102:
103: public void setParameters(final ArrayList parameters) {
104: this .parameters = parameters;
105: }
106:
107: public List getParameters() {
108: return this .parameters;
109: }
110:
111: public Object getProcOutputDesc() {
112: return null;
113: }
114:
115: public void setNumParameters(final int numParameters) {
116: this .numParameters = numParameters;
117: }
118:
119: public int getNumParameters() {
120: return this .numParameters;
121: }
122:
123: /**
124: * returns the list of ResultSet descriptors
125: *
126: * @return procResultSetDesc
127: */
128: public ArrayList getProcResultSetDesc() {
129: return this .procResultSetDesc;
130: }
131:
132: /**
133: * anupam added sets resultSet descriptor.
134: *
135: * @param procrsd List containing the ResultSetDescriptor
136: */
137: public void setProcResultSetDesc(final ArrayList procrsd) {
138: this .procResultSetDesc = procrsd;
139: }
140:
141: /**
142: * added anupam Sets the count of Result Set
143: *
144: * @param numResultSets count of ResultSet
145: */
146: public void setNumResultSets(final int numResultSets) {
147: this .numResultSets = numResultSets;
148: }
149:
150: /**
151: * added anupam returns the number of ResultSets
152: *
153: * @return numResultSets
154: */
155: public int getNumResultSets() {
156: return this .numResultSets;
157: }
158:
159: // added till here
160: }
|