1 package com.daffodilwoods.daffodildb.server.sql99.ddl.descriptors; 2 3 import com.daffodilwoods.daffodildb.server.datadictionarysystem.*; 4 import com.daffodilwoods.daffodildb.server.serversystem.*; 5 import com.daffodilwoods.daffodildb.server.sql99.dql.iterator.*; 6 import com.daffodilwoods.daffodildb.server.sql99.expression.booleanvalueexpression.*; 7 import com.daffodilwoods.daffodildb.server.sql99.utils.parser.*; 8 import com.daffodilwoods.database.resource.*; 9 10 public class MethodSpecifiactionParametersDescriptor extends Descriptor { 11 12 public String SPECIFIC_CATALOG; 13 public String SPECIFIC_SCHEMA; 14 public String SPECIFIC_NAME; 15 public String METHOD_CATALOG; 16 public String METHOD_SCHEMA; 17 public String METHOD_NAME; 18 public String METHOD_SPECIFICATION_IDENTIFIER; 19 int ORDINAL_POSITION; 20 public String DTD_IDENTIFIER; 21 public String PARAMETER_MODE; 22 public String IS_RESULT; 23 public String AS_LOCATOR; 24 public String PARAMETER_NAME; 25 public String FROM_SQL_SPECIFIC_CATALOG; 26 public String FROM_SQL_SPECIFIC_SCHEMA; 27 public String FROM_SQL_SPECIFIC_NAME; 28 29 public MethodSpecifiactionParametersDescriptor() throws DException { 30 } 31 32 public void load(_ServerSession serverSession) throws DException { 33 String clause = "select * from " + 34 SystemTables.method_specification_parameters_TableName 35 + " where Specific_Catalog = ? and Specific_Schema = ? and Specific_Name = ? and Method_Catalog = ? and Method_Schema = ? and Method_Name = ? and Method_Specification_Identifier = ? and Oridinal_Position = ?"; 36 _SelectQueryIterator iter = SqlSchemaConstants.getIterator(serverSession, clause, 37 new Object [] {SPECIFIC_CATALOG, SPECIFIC_SCHEMA, SPECIFIC_NAME, 38 METHOD_CATALOG, METHOD_SCHEMA, METHOD_NAME, 39 METHOD_SPECIFICATION_IDENTIFIER, new Integer (ORDINAL_POSITION)}); 40 if (iter.first()) { 41 Object [] obj = (Object []) iter.getObject(); 42 43 DTD_IDENTIFIER = (String ) obj[SystemTablesFields. 44 method_Specifications_Parameters_Dtd_Identifier]; 45 PARAMETER_MODE = (String ) obj[SystemTablesFields. 46 method_Specifications_Parameters_Parameter_Mode]; 47 IS_RESULT = (String ) obj[SystemTablesFields. 48 method_Specifications_Parameters_Is_Result]; 49 AS_LOCATOR = (String ) obj[SystemTablesFields. 50 method_Specifications_Parameters_As_Locator]; 51 PARAMETER_NAME = (String ) obj[SystemTablesFields. 52 method_Specifications_Parameters_Parameter_Name]; 53 FROM_SQL_SPECIFIC_CATALOG = (String ) obj[SystemTablesFields. 54 method_Specifications_Parameters_From_SQL_Specific_Catalog]; 55 FROM_SQL_SPECIFIC_SCHEMA = (String ) obj[SystemTablesFields. 56 method_Specifications_Parameters_From_SQL_Specific_Schema]; 57 FROM_SQL_SPECIFIC_NAME = (String ) obj[SystemTablesFields. 58 method_Specifications_Parameters_From_SQL_Specific_Name]; 59 60 } else { 61 throw new DException("DSE723", null); 62 } 63 } 64 65 public void save(_ServerSession serverSession) throws DException { 66 Object [] values = new Object [] { 67 SPECIFIC_CATALOG, 68 SPECIFIC_SCHEMA, 69 SPECIFIC_NAME, 70 METHOD_CATALOG, 71 METHOD_SCHEMA, 72 METHOD_NAME, 73 METHOD_SPECIFICATION_IDENTIFIER, 74 new Integer (ORDINAL_POSITION), 75 DTD_IDENTIFIER, 76 PARAMETER_MODE, 77 IS_RESULT, 78 AS_LOCATOR, 79 PARAMETER_NAME, 80 FROM_SQL_SPECIFIC_CATALOG, 81 FROM_SQL_SPECIFIC_SCHEMA, 82 FROM_SQL_SPECIFIC_NAME 83 }; 84 SqlSchemaConstants.insert(serverSession, 85 SystemTables. 86 method_specification_parameters_TableName, null, 87 values); 88 89 } 90 91 public void loadDataFromRecord(_SelectQueryIterator iter) throws DException { 92 Object [] obj = (Object []) iter.getObject(); 93 SPECIFIC_CATALOG = (String ) obj[SystemTablesFields. 94 method_Specifications_Parameters_Specific_Catalog]; 95 SPECIFIC_SCHEMA = (String ) obj[SystemTablesFields. 96 method_Specifications_Parameters_Specific_Schema]; 97 SPECIFIC_NAME = (String ) obj[SystemTablesFields. 98 method_Specifications_Parameters_Specific_Name]; 99 METHOD_CATALOG = (String ) obj[SystemTablesFields. 100 method_Specifications_Parameters_Method_Catalog]; 101 METHOD_SCHEMA = (String ) obj[SystemTablesFields. 102 method_Specifications_Parameters_Method_Schema]; 103 METHOD_NAME = (String ) obj[SystemTablesFields. 104 method_Specifications_Parameters_Method_Name]; 105 METHOD_SPECIFICATION_IDENTIFIER = (String ) obj[SystemTablesFields. 106 method_Specifications_Parameters_Method_Specification_Identifier]; 107 ORDINAL_POSITION = obj[SystemTablesFields. 108 method_Specifications_Parameters_Oridinal_Position].hashCode(); 109 110 DTD_IDENTIFIER = (String ) obj[SystemTablesFields. 111 method_Specifications_Parameters_Dtd_Identifier]; 112 PARAMETER_MODE = (String ) obj[SystemTablesFields. 113 method_Specifications_Parameters_Parameter_Mode]; 114 IS_RESULT = (String ) obj[SystemTablesFields. 115 method_Specifications_Parameters_Is_Result]; 116 AS_LOCATOR = (String ) obj[SystemTablesFields. 117 method_Specifications_Parameters_As_Locator]; 118 PARAMETER_NAME = (String ) obj[SystemTablesFields. 119 method_Specifications_Parameters_Parameter_Name]; 120 FROM_SQL_SPECIFIC_CATALOG = (String ) obj[SystemTablesFields. 121 method_Specifications_Parameters_From_SQL_Specific_Catalog]; 122 FROM_SQL_SPECIFIC_SCHEMA = (String ) obj[SystemTablesFields. 123 method_Specifications_Parameters_From_SQL_Specific_Schema]; 124 FROM_SQL_SPECIFIC_NAME = (String ) obj[SystemTablesFields. 125 method_Specifications_Parameters_From_SQL_Specific_Name]; 126 127 } 128 129 public void delete(_ServerSession serverSession) throws DException { 130 String bve = "SPECIFIC_CATALOG=? and SPECIFIC_SCHEMA=? and SPECIFIC_NAME=? and METHOD_CATALOG=? and METHOD_SCHEMA=? and METHOD_NAME=? and METHOD_SPECIFICATION_IDENTIFIER=? and ORDINAL_POSITION=?"; 131 _ServerSession globalSession = serverSession.getGlobalSession(); 132 booleanvalueexpression condition = ConditionParser.parseCondition(bve, 133 globalSession, 134 SqlSchemaConstants.method_specification_parameters_TableName); 135 super.delete(serverSession, 136 SqlSchemaConstants.method_specification_parameters_TableName, 137 condition, new Object [] {SPECIFIC_CATALOG, SPECIFIC_SCHEMA, 138 SPECIFIC_NAME, METHOD_CATALOG, METHOD_SCHEMA, 139 METHOD_NAME, METHOD_SPECIFICATION_IDENTIFIER, 140 new Integer (ORDINAL_POSITION)} 141 ); 142 } 143 144 public int getDescriptorType() { 145 return METHOD_SPECIFICATION_PARAMETERS_DESCRIPTOR; 146 } 147 } 148 | Popular Tags |