1 21 22 package org.apache.derby.impl.sql.catalog; 23 24 import org.apache.derby.catalog.UUID; 25 import org.apache.derby.catalog.Dependable; 26 import org.apache.derby.iapi.sql.dictionary.DataDictionary; 27 import org.apache.derby.iapi.sql.dictionary.TableDescriptor; 28 import org.apache.derby.iapi.error.StandardException; 29 30 import org.apache.derby.iapi.services.io.FormatableHashtable; 31 import org.apache.derby.iapi.services.io.FormatableBitSet; 32 33 import java.io.ObjectOutput ; 34 import java.io.ObjectInput ; 35 import java.io.IOException ; 36 37 44 45 public class DDColumnDependableFinder extends DDdependableFinder 46 { 47 53 private byte[] columnBitMap; 56 57 63 66 public DDColumnDependableFinder(int formatId) 67 { 68 super(formatId); 69 } 70 71 74 public DDColumnDependableFinder(int formatId, byte[] columnBitMap) 75 { 76 super(formatId); 77 this.columnBitMap = columnBitMap; 78 } 79 80 86 92 public byte[] getColumnBitMap() 93 { 94 return columnBitMap; 95 } 96 97 103 public void setColumnBitMap(byte[] columnBitMap) 104 { 105 this.columnBitMap = columnBitMap; 106 } 107 108 117 protected Dependable getDependable(DataDictionary dd, UUID dependableObjectID) 118 throws StandardException 119 { 120 TableDescriptor td = dd.getTableDescriptor(dependableObjectID); 121 if (td != null) td.setReferencedColumnMap(new FormatableBitSet(columnBitMap)); 123 return td; 124 } 125 126 132 138 public void readExternal( ObjectInput in ) 139 throws IOException , ClassNotFoundException 140 { 141 super.readExternal(in); 142 FormatableHashtable fh = (FormatableHashtable)in.readObject(); 143 columnBitMap = (byte[])fh.get("columnBitMap"); 144 } 145 146 152 public void writeExternal( ObjectOutput out ) 153 throws IOException 154 { 155 super.writeExternal(out); 156 FormatableHashtable fh = new FormatableHashtable(); 157 fh.put("columnBitMap", columnBitMap); 158 out.writeObject(fh); 159 } 160 } 161 | Popular Tags |