KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > sql > catalog > SYSTRIGGERSRowFactory


1 /*
2
3    Derby - Class org.apache.derby.impl.sql.catalog.SYSTRIGGERSRowFactory
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.impl.sql.catalog;
23
24 import org.apache.derby.iapi.types.DataTypeDescriptor;
25 import org.apache.derby.iapi.types.DataValueDescriptor;
26 import org.apache.derby.iapi.types.TypeId;
27
28 import org.apache.derby.iapi.types.TypeId;
29
30 import org.apache.derby.iapi.types.DataValueFactory;
31 import org.apache.derby.iapi.types.RowLocation;
32
33 import org.apache.derby.iapi.sql.dictionary.CatalogRowFactory;
34 import org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator;
35 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
36 import org.apache.derby.iapi.sql.dictionary.SystemColumn;
37 import org.apache.derby.iapi.sql.dictionary.TriggerDescriptor;
38 import org.apache.derby.iapi.sql.dictionary.TupleDescriptor;
39
40 import org.apache.derby.iapi.sql.execute.ExecIndexRow;
41 import org.apache.derby.iapi.sql.execute.ExecRow;
42 import org.apache.derby.iapi.sql.execute.ExecutionFactory;
43
44 import org.apache.derby.iapi.error.StandardException;
45
46 import org.apache.derby.iapi.services.monitor.Monitor;
47 import org.apache.derby.catalog.ReferencedColumns;
48 import org.apache.derby.catalog.types.ReferencedColumnsDescriptorImpl;
49 import org.apache.derby.catalog.UUID;
50 import org.apache.derby.iapi.services.uuid.UUIDFactory;
51
52 import org.apache.derby.iapi.services.sanity.SanityManager;
53 import org.apache.derby.iapi.types.SQLTimestamp;
54 import java.sql.Timestamp JavaDoc;
55
56 /**
57  * Factory for creating a SYSTRIGGERS row.
58  *
59  *
60  * @version 0.1
61  * @author Jamie
62  */

63
64 public class SYSTRIGGERSRowFactory extends CatalogRowFactory
65 {
66     static final String JavaDoc TABLENAME_STRING = "SYSTRIGGERS";
67
68     /* Column #s for sysinfo (1 based) */
69     public static final int SYSTRIGGERS_TRIGGERID = 1;
70     public static final int SYSTRIGGERS_TRIGGERNAME = 2;
71     public static final int SYSTRIGGERS_SCHEMAID = 3;
72     public static final int SYSTRIGGERS_CREATIONTIMESTAMP = 4;
73     public static final int SYSTRIGGERS_EVENT = 5;
74     public static final int SYSTRIGGERS_FIRINGTIME = 6;
75     public static final int SYSTRIGGERS_TYPE = 7;
76     public static final int SYSTRIGGERS_STATE = TriggerDescriptor.SYSTRIGGERS_STATE_FIELD;
77     public static final int SYSTRIGGERS_TABLEID = 9;
78     public static final int SYSTRIGGERS_WHENSTMTID = 10;
79     public static final int SYSTRIGGERS_ACTIONSTMTID = 11;
80     public static final int SYSTRIGGERS_REFERENCEDCOLUMNS = 12;
81     public static final int SYSTRIGGERS_TRIGGERDEFINITION = 13;
82     public static final int SYSTRIGGERS_REFERENCINGOLD = 14;
83     public static final int SYSTRIGGERS_REFERENCINGNEW = 15;
84     public static final int SYSTRIGGERS_OLDREFERENCINGNAME = 16;
85     public static final int SYSTRIGGERS_NEWREFERENCINGNAME = 17;
86
87     public static final int SYSTRIGGERS_COLUMN_COUNT = SYSTRIGGERS_NEWREFERENCINGNAME;
88
89     public static final int SYSTRIGGERS_INDEX1_ID = 0;
90     public static final int SYSTRIGGERS_INDEX2_ID = 1;
91     public static final int SYSTRIGGERS_INDEX3_ID = 2;
92
93     private static final int[][] indexColumnPositions =
94     {
95         {SYSTRIGGERS_TRIGGERID},
96         {SYSTRIGGERS_TRIGGERNAME, SYSTRIGGERS_SCHEMAID},
97         {SYSTRIGGERS_TABLEID, SYSTRIGGERS_CREATIONTIMESTAMP}
98     };
99
100     private static final boolean[] uniqueness = {
101                                                        true,
102                                                        true,
103                                                        false,
104                                                      };
105
106     private static final String JavaDoc[] uuids =
107     {
108          "c013800d-00d7-c025-4809-000a0a411200" // catalog UUID
109
,"c013800d-00d7-c025-480a-000a0a411200" // heap UUID
110
,"c013800d-00d7-c025-480b-000a0a411200" // SYSTRIGGERS_INDEX1
111
,"c013800d-00d7-c025-480c-000a0a411200" // SYSTRIGGERS_INDEX2
112
,"c013800d-00d7-c025-480d-000a0a411200" // SYSTRIGGERS_INDEX3
113
};
114
115     /////////////////////////////////////////////////////////////////////////////
116
//
117
// CONSTRUCTORS
118
//
119
/////////////////////////////////////////////////////////////////////////////
120
public SYSTRIGGERSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf,
121                                   boolean convertIdToLower)
122     {
123         super(uuidf,ef,dvf,convertIdToLower);
124         initInfo(SYSTRIGGERS_COLUMN_COUNT, TABLENAME_STRING,
125                  indexColumnPositions, uniqueness, uuids);
126     }
127
128     /////////////////////////////////////////////////////////////////////////////
129
//
130
// METHODS
131
//
132
/////////////////////////////////////////////////////////////////////////////
133
/**
134      * Make a SYSTRIGGERS row.
135      *
136      * @return Row suitable for inserting into SYSTRIGGERS.
137      *
138      * @exception StandardException thrown on failure
139      */

140
141     public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
142         throws StandardException
143     {
144         DataTypeDescriptor dtd;
145         ExecRow row;
146         DataValueDescriptor col;
147         String JavaDoc name = null;
148         UUID uuid = null;
149         UUID suuid = null; // schema
150
UUID tuuid = null; // referenced table
151
UUID actionSPSID = null; // action sps uuid string
152
UUID whenSPSID = null; // when clause sps uuid string
153
Timestamp createTime = null;
154         String JavaDoc event = null;
155         String JavaDoc time = null;
156         String JavaDoc type = null;
157         String JavaDoc enabled = null;
158         String JavaDoc triggerDefinition = null;
159         String JavaDoc oldReferencingName = null;
160         String JavaDoc newReferencingName = null;
161         ReferencedColumns rcd = null;
162         boolean referencingOld = false;
163         boolean referencingNew = false;
164
165         if (td != null)
166         {
167             TriggerDescriptor triggerDescriptor = (TriggerDescriptor)td;
168             name = triggerDescriptor.getName();
169             uuid = triggerDescriptor.getUUID();
170             suuid = triggerDescriptor.getSchemaDescriptor().getUUID();
171             createTime = triggerDescriptor.getCreationTimestamp();
172             // for now we are assuming that a trigger can only listen to a single event
173
event = triggerDescriptor.listensForEvent(TriggerDescriptor.TRIGGER_EVENT_UPDATE) ? "U" :
174                     triggerDescriptor.listensForEvent(TriggerDescriptor.TRIGGER_EVENT_DELETE) ? "D" : "I";
175             time = triggerDescriptor.isBeforeTrigger() ? "B" : "A";
176             type = triggerDescriptor.isRowTrigger() ? "R" : "S";
177             enabled = triggerDescriptor.isEnabled() ? "E" : "D";
178             tuuid = triggerDescriptor.getTableDescriptor().getUUID();
179             int[] refCols = triggerDescriptor.getReferencedCols();
180             rcd = (refCols != null) ? new
181                 ReferencedColumnsDescriptorImpl(refCols) : null;
182
183             actionSPSID = triggerDescriptor.getActionId();
184             whenSPSID = triggerDescriptor.getWhenClauseId();
185             triggerDefinition = triggerDescriptor.getTriggerDefinition();
186             referencingOld = triggerDescriptor.getReferencingOld();
187             referencingNew = triggerDescriptor.getReferencingNew();
188             oldReferencingName = triggerDescriptor.getOldReferencingName();
189             newReferencingName = triggerDescriptor.getNewReferencingName();
190         }
191
192         /* Build the row to insert */
193         row = getExecutionFactory().getValueRow(SYSTRIGGERS_COLUMN_COUNT);
194
195         /* 1st column is TRIGGERID */
196         row.setColumn(1, dvf.getCharDataValue((uuid == null) ? null : uuid.toString()));
197
198         /* 2nd column is TRIGGERNAME */
199         row.setColumn(2, dvf.getVarcharDataValue(name));
200
201         /* 3rd column is SCHEMAID */
202         row.setColumn(3, dvf.getCharDataValue((suuid == null) ? null : suuid.toString()));
203
204         /* 4th column is CREATIONTIMESTAMP */
205         row.setColumn(4, dvf.getDataValue(createTime));
206
207         /* 5th column is EVENT */
208         row.setColumn(5, dvf.getCharDataValue(event));
209
210         /* 6th column is FIRINGTIME */
211         row.setColumn(6, dvf.getCharDataValue(time));
212
213         /* 7th column is TYPE */
214         row.setColumn(7, dvf.getCharDataValue(type));
215
216         /* 8th column is STATE */
217         row.setColumn(8, dvf.getCharDataValue(enabled));
218
219         /* 9th column is TABLEID */
220         row.setColumn(9, dvf.getCharDataValue((tuuid == null) ? null : tuuid.toString()));
221
222         /* 10th column is WHENSTMTID */
223         row.setColumn(10, dvf.getCharDataValue((whenSPSID == null) ? null : whenSPSID.toString()));
224
225         /* 11th column is ACTIONSTMTID */
226         row.setColumn(11, dvf.getCharDataValue((actionSPSID == null) ? null : actionSPSID.toString()));
227
228         /* 12th column is REFERENCEDCOLUMNS
229          * (user type org.apache.derby.catalog.ReferencedColumns)
230          */

231         row.setColumn(12, dvf.getDataValue(rcd));
232
233         /* 13th column is TRIGGERDEFINITION */
234         row.setColumn(13, dvf.getLongvarcharDataValue(triggerDefinition));
235
236         /* 14th column is REFERENCINGOLD */
237         row.setColumn(14, dvf.getDataValue(referencingOld));
238
239         /* 15th column is REFERENCINGNEW */
240         row.setColumn(15, dvf.getDataValue(referencingNew));
241
242         /* 16th column is OLDREFERENCINGNAME */
243         row.setColumn(16, dvf.getVarcharDataValue(oldReferencingName));
244
245         /* 17th column is NEWREFERENCINGNAME */
246         row.setColumn(17, dvf.getVarcharDataValue(newReferencingName));
247
248         return row;
249     }
250
251
252     ///////////////////////////////////////////////////////////////////////////
253
//
254
// ABSTRACT METHODS TO BE IMPLEMENTED BY CHILDREN OF CatalogRowFactory
255
//
256
///////////////////////////////////////////////////////////////////////////
257

258     /**
259      * Make an Tuple Descriptor out of a SYSTRIGGERS row
260      *
261      * @param row a SYSTRIGGERS row
262      * @param parentTupleDescriptor unused
263      * @param dd dataDictionary
264      *
265      * @return a descriptor equivalent to a SYSTRIGGERS row
266      *
267      * @exception StandardException thrown on failure
268      */

269     public TupleDescriptor buildDescriptor
270     (
271         ExecRow row,
272         TupleDescriptor parentTupleDescriptor,
273         DataDictionary dd
274     ) throws StandardException
275     {
276         DataValueDescriptor col;
277         String JavaDoc name;
278         char theChar;
279         String JavaDoc uuidStr;
280         String JavaDoc triggerDefinition;
281         String JavaDoc oldReferencingName;
282         String JavaDoc newReferencingName;
283         UUID uuid;
284         UUID suuid; // schema
285
UUID tuuid; // referenced table
286
UUID actionSPSID = null; // action sps uuid string
287
UUID whenSPSID = null; // when clause sps uuid string
288
Timestamp createTime;
289         int eventMask = 0;
290         boolean isBefore;
291         boolean isRow;
292         boolean isEnabled;
293         boolean referencingOld;
294         boolean referencingNew;
295         ReferencedColumns rcd;
296         TriggerDescriptor descriptor;
297         DataDescriptorGenerator ddg = dd.getDataDescriptorGenerator();
298
299         if (SanityManager.DEBUG)
300         {
301             SanityManager.ASSERT(row.nColumns() == SYSTRIGGERS_COLUMN_COUNT,
302                                  "Wrong number of columns for a SYSTRIGGERS row");
303         }
304
305         // 1st column is TRIGGERID (UUID - char(36))
306
col = row.getColumn(1);
307         uuidStr = col.getString();
308         uuid = getUUIDFactory().recreateUUID(uuidStr);
309
310         // 2nd column is TRIGGERNAME (varchar(128))
311
col = row.getColumn(2);
312         name = col.getString();
313
314         // 3rd column is SCHEMAID (UUID - char(36))
315
col = row.getColumn(3);
316         uuidStr = col.getString();
317         suuid = getUUIDFactory().recreateUUID(uuidStr);
318
319         // 4th column is CREATIONTIMESTAMP (TIMESTAMP)
320
col = row.getColumn(4);
321         createTime = (Timestamp) col.getObject();
322
323         // 5th column is EVENT (char(1))
324
col = row.getColumn(5);
325         theChar = col.getString().charAt(0);
326         switch (theChar)
327         {
328             case 'U':
329                         eventMask = TriggerDescriptor.TRIGGER_EVENT_UPDATE;
330                         break;
331
332             case 'I':
333                         eventMask = TriggerDescriptor.TRIGGER_EVENT_INSERT;
334                         break;
335
336             case 'D':
337                         eventMask = TriggerDescriptor.TRIGGER_EVENT_DELETE;
338                         break;
339
340             default:
341                     if (SanityManager.DEBUG)
342                     {
343                         SanityManager.THROWASSERT("bad event mask: "+theChar);
344                     }
345         }
346         
347         // 6th column is FIRINGTIME (char(1))
348
isBefore = getCharBoolean(row.getColumn(6), 'B', 'A');
349
350         // 7th column is TYPE (char(1))
351
isRow = getCharBoolean(row.getColumn(7), 'R', 'S');
352
353         // 8th column is STATE (char(1))
354
isEnabled = getCharBoolean(row.getColumn(8), 'E', 'D');
355
356         // 9th column is TABLEID (UUID - char(36))
357
col = row.getColumn(9);
358         uuidStr = col.getString();
359         tuuid = getUUIDFactory().recreateUUID(uuidStr);
360
361         // 10th column is WHENSTMTID (UUID - char(36))
362
col = row.getColumn(10);
363         uuidStr = col.getString();
364         if (uuidStr != null)
365             whenSPSID = getUUIDFactory().recreateUUID(uuidStr);
366
367         // 11th column is ACTIONSTMTID (UUID - char(36))
368
col = row.getColumn(11);
369         uuidStr = col.getString();
370         if (uuidStr != null)
371             actionSPSID = getUUIDFactory().recreateUUID(uuidStr);
372
373         // 12th column is REFERENCEDCOLUMNS user type org.apache.derby.catalog.ReferencedColumns
374
col = row.getColumn(12);
375         rcd = (ReferencedColumns) col.getObject();
376
377         // 13th column is TRIGGERDEFINITION (longvarhar)
378
col = row.getColumn(13);
379         triggerDefinition = col.getString();
380
381         // 14th column is REFERENCINGOLD (boolean)
382
col = row.getColumn(14);
383         referencingOld = col.getBoolean();
384
385         // 15th column is REFERENCINGNEW (boolean)
386
col = row.getColumn(15);
387         referencingNew = col.getBoolean();
388
389         // 16th column is REFERENCINGNAME (varchar(128))
390
col = row.getColumn(16);
391         oldReferencingName = col.getString();
392
393         // 17th column is REFERENCINGNAME (varchar(128))
394
col = row.getColumn(17);
395         newReferencingName = col.getString();
396
397         descriptor = new TriggerDescriptor(
398                                     dd,
399                                     dd.getSchemaDescriptor(suuid, null),
400                                     uuid,
401                                     name,
402                                     eventMask,
403                                     isBefore,
404                                     isRow,
405                                     isEnabled,
406                                     dd.getTableDescriptor(tuuid),
407                                     whenSPSID,
408                                     actionSPSID,
409                                     createTime,
410                                     (rcd == null) ? (int[])null : rcd.getReferencedColumnPositions(),
411                                     triggerDefinition,
412                                     referencingOld,
413                                     referencingNew,
414                                     oldReferencingName,
415                                     newReferencingName
416                                     );
417
418         return descriptor;
419     }
420
421             
422     /**
423      * Builds a list of columns suitable for creating this Catalog.
424      * The last column, the serialized statement, is not added
425      * to the column list. This is done deliberately to make it
426      * a 'hidden' column -- one that is not visible to customers,
427      * but is visible to the system.
428      *
429      *
430      * @return array of SystemColumn suitable for making this catalog.
431      */

432     public SystemColumn[] buildColumnList()
433     {
434         SystemColumn[] columnList = new SystemColumn[SYSTRIGGERS_COLUMN_COUNT];
435
436         // describe columns
437
columnList[SYSTRIGGERS_TRIGGERID-1] = new SystemColumnImpl(
438                             convertIdCase( "TRIGGERID"), // name
439
SYSTRIGGERS_TRIGGERID, // column number
440
0, // precision
441
0, // scale
442
false, // nullability
443
"CHAR", // dataType
444
true, // built-in type
445
36 // maxLength
446
);
447
448         columnList[SYSTRIGGERS_TRIGGERNAME-1] =
449                     new SystemColumnImpl( // SQL IDENTIFIER
450
convertIdCase( "TRIGGERNAME"), // column name
451
SYSTRIGGERS_TRIGGERNAME, // column number
452
false // nullability
453
);
454
455         columnList[SYSTRIGGERS_SCHEMAID-1] = new SystemColumnImpl(
456                             convertIdCase( "SCHEMAID"), // name
457
SYSTRIGGERS_SCHEMAID, // column number
458
0, // precision
459
0, // scale
460
false, // nullability
461
"CHAR", // dataType
462
true, // built-in type
463
36 // maxLength
464
);
465
466         columnList[SYSTRIGGERS_CREATIONTIMESTAMP-1] =
467                     new SystemColumnImpl(
468                             convertIdCase( "CREATIONTIMESTAMP"), // name
469
SYSTRIGGERS_CREATIONTIMESTAMP, // column number
470
0, // precision
471
0, // scale
472
false, // nullability
473
"TIMESTAMP", // dataType
474
true, // built-in type
475
TypeId.TIMESTAMP_MAXWIDTH // maxLength
476
);
477
478         columnList[SYSTRIGGERS_EVENT-1] =
479                     new SystemColumnImpl(
480                             convertIdCase( "EVENT"), // name
481
SYSTRIGGERS_EVENT, // column number
482
0, // precision
483
0, // scale
484
false, // nullability
485
"CHAR", // dataType
486
true, // built-in type
487
1 // maxLength
488
);
489
490         columnList[SYSTRIGGERS_FIRINGTIME-1] =
491                     new SystemColumnImpl(
492                             convertIdCase( "FIRINGTIME"), // name
493
SYSTRIGGERS_FIRINGTIME, // column number
494
0, // precision
495
0, // scale
496
false, // nullability
497
"CHAR", // dataType
498
true, // built-in type
499
1 // maxLength
500
);
501
502         columnList[SYSTRIGGERS_TYPE-1] =
503                     new SystemColumnImpl(
504                             convertIdCase( "TYPE"), // name
505
SYSTRIGGERS_TYPE, // column number
506
0, // precision
507
0, // scale
508
false, // nullability
509
"CHAR", // dataType
510
true, // built-in type
511
1 // maxLength
512
);
513
514         columnList[SYSTRIGGERS_STATE-1] =
515                     new SystemColumnImpl(
516                             convertIdCase( "STATE"), // name
517
SYSTRIGGERS_STATE,// column number
518
0, // precision
519
0, // scale
520
false, // nullability
521
"CHAR", // dataType
522
true, // built-in type
523
1 // maxLength
524
);
525
526         columnList[SYSTRIGGERS_TABLEID-1] =
527                     new SystemColumnImpl(
528                             convertIdCase( "TABLEID"), // name
529
SYSTRIGGERS_TABLEID, // column number
530
0, // precision
531
0, // scale
532
false, // nullability
533
"CHAR", // dataType
534
true, // built-in type
535
36 // maxLength
536
);
537
538         columnList[SYSTRIGGERS_WHENSTMTID-1] =
539                     new SystemColumnImpl(
540                             convertIdCase( "WHENSTMTID"), // name
541
SYSTRIGGERS_WHENSTMTID, // column number
542
0, // precision
543
0, // scale
544
true, // nullability
545
"CHAR", // dataType
546
true, // built-in type
547
36 // maxLength
548
);
549
550         columnList[SYSTRIGGERS_ACTIONSTMTID-1] =
551                     new SystemColumnImpl(
552                             convertIdCase( "ACTIONSTMTID"), // name
553
SYSTRIGGERS_ACTIONSTMTID, // column number
554
0, // precision
555
0, // scale
556
true, // nullability
557
"CHAR", // dataType
558
true, // built-in type
559
36 // maxLength
560
);
561
562         columnList[SYSTRIGGERS_REFERENCEDCOLUMNS-1] =
563                     new SystemColumnImpl(
564                             convertIdCase( "REFERENCEDCOLUMNS"), // name
565
SYSTRIGGERS_REFERENCEDCOLUMNS, // column number
566
0, // precision
567
0, // scale
568
true, // nullability
569
"org.apache.derby.catalog.ReferencedColumns", //datatype
570
false, // built-in type
571
DataTypeDescriptor.MAXIMUM_WIDTH_UNKNOWN // maxLength
572
);
573
574         columnList[SYSTRIGGERS_TRIGGERDEFINITION-1] =
575                     new SystemColumnImpl(
576                             convertIdCase( "TRIGGERDEFINITION"), // name
577
SYSTRIGGERS_TRIGGERDEFINITION, // column number
578
0, // precision
579
0, // scale
580
true, // nullability
581
"LONG VARCHAR", // dataType
582
true, // built-in type
583
Integer.MAX_VALUE // maxLength
584
);
585
586         columnList[SYSTRIGGERS_REFERENCINGOLD-1] =
587                     new SystemColumnImpl(
588                             convertIdCase( "REFERENCINGOLD"), // name
589
SYSTRIGGERS_REFERENCINGOLD,// column number
590
0, // precision
591
0, // scale
592
true, // nullability
593
"BOOLEAN", // dataType
594
true, // built-in type
595
1 // maxLength
596
);
597
598         columnList[SYSTRIGGERS_REFERENCINGNEW-1] =
599                     new SystemColumnImpl(
600                             convertIdCase( "REFERENCINGNEW"), // name
601
SYSTRIGGERS_REFERENCINGNEW,// column number
602
0, // precision
603
0, // scale
604
true, // nullability
605
"BOOLEAN", // dataType
606
true, // built-in type
607
1 // maxLength
608
);
609
610         columnList[SYSTRIGGERS_OLDREFERENCINGNAME-1] =
611                     new SystemColumnImpl( // SQL IDENTIFIER
612
convertIdCase( "OLDREFERENCINGNAME"), // column name
613
SYSTRIGGERS_OLDREFERENCINGNAME, // column number
614
true // nullability
615
);
616
617         columnList[SYSTRIGGERS_NEWREFERENCINGNAME-1] =
618                     new SystemColumnImpl( // SQL IDENTIFIER
619
convertIdCase( "NEWREFERENCINGNAME"), // column name
620
SYSTRIGGERS_NEWREFERENCINGNAME, // column number
621
true // nullability
622
);
623
624         return columnList;
625     }
626
627     // a little helper
628
private boolean getCharBoolean(DataValueDescriptor col, char trueValue, char falseValue) throws StandardException
629     {
630         char theChar = col.getString().charAt(0);
631         if (theChar == trueValue)
632         {
633             return true;
634         }
635         else if (theChar == falseValue)
636         {
637             return false;
638         }
639         else
640         {
641             if (SanityManager.DEBUG)
642                 SanityManager.THROWASSERT("bad char value "+theChar);
643         
644             return true;
645         }
646     }
647 }
648
Popular Tags