KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > serversystem > deeprecordcopy > ColumnInfo


1 package com.daffodilwoods.daffodildb.server.serversystem.deeprecordcopy;
2
3 import com.daffodilwoods.database.resource.*;
4 public class ColumnInfo {
5
6     int dataType;
7     boolean isUnique;
8     boolean isPrimary;
9     boolean isReferencing;
10     int columnCode;
11     boolean hasCode;
12     boolean isReferenced;
13
14     public int getColumnCode() throws DException{
15         if(hasCode)
16             return columnCode;
17         if(isReferencing)
18             columnCode = 5;
19         else if((isUnique||isPrimary)&&dataType == 16)
20             columnCode = 4;
21         else if((isUnique||isPrimary) && dataType == 5 )//is autoincremental
22
columnCode = 1;
23         else
24             columnCode = 3;
25         return columnCode;
26     }
27
28     public void setColumnCode(int columnCode0) {
29         columnCode = columnCode0;
30         hasCode = true;
31     }
32
33 }
34
Popular Tags