1 package com.daffodilwoods.daffodildb.server.sql99.dql.listenerevents; 2 3 import com.daffodilwoods.daffodildb.server.sql99.common.*; 4 import com.daffodilwoods.database.resource.*; 5 6 15 16 public class ForeignKeyColumns implements java.io.Serializable { 17 18 21 22 private String [] columns; 23 24 27 28 private int[] indexes; 29 30 public ForeignKeyColumns(String [] columns0, Integer [] integer) { 31 columns = columns0; 32 int length = integer.length; 33 indexes = new int[length]; 34 for (int i = 0; i < length; i++) { 35 indexes[i] = integer[i].hashCode(); 36 } 37 } 38 39 44 45 public int[] getIndexes() throws DException { 46 return indexes; 47 } 48 49 54 55 public String [] getColumns() throws DException { 56 return columns; 57 } 58 59 66 67 public boolean ifMatches(String [] target) throws DException { 68 return GeneralPurposeStaticClass.compareArrays(columns, target); 69 } 70 71 78 79 public boolean liesInRange(int index) throws DException { 80 int len = indexes.length; 81 for (int i = 0; i < len; i++) { 82 if (index == indexes[i]) { 83 return true; 84 } 85 } 86 return false; 87 } 88 89 94 95 public boolean hasForeignTable() { 96 return columns.length > 1; 97 } 98 } 99 | Popular Tags |