| 1 package com.quadcap.sql; 2 3 40 41 import java.io.ByteArrayOutputStream ; 42 import java.io.Externalizable ; 43 import java.io.IOException ; 44 import java.io.ObjectInput ; 45 import java.io.ObjectOutput ; 46 47 import java.util.Vector ; 48 49 import java.sql.ResultSet ; 50 import java.sql.SQLException ; 51 52 import com.quadcap.sql.io.ObjectInputStream; 53 import com.quadcap.sql.io.ObjectOutputStream; 54 55 import com.quadcap.sql.index.Btree; 56 57 import com.quadcap.sql.file.BlockFile; 58 59 import com.quadcap.sql.types.ValueInteger; 60 61 import com.quadcap.util.Debug; 62 import com.quadcap.util.Util; 63 64 69 public class NonUniqueIndexConstraint 70 extends IndexConstraint 71 implements Externalizable  72 { 73 public NonUniqueIndexConstraint() {} 74 75 public NonUniqueIndexConstraint(String name) { 76 super(name); 77 } 78 79 public NonUniqueIndexConstraint(String name, Vector names) { 80 super(name, names); 81 } 82 83 public void readExternal(ObjectInput in) 84 throws IOException , ClassNotFoundException  85 { 86 super.readExternal(in); 87 } 88 89 public void writeExternal(ObjectOutput out) throws IOException { 90 super.writeExternal(out); 91 } 92 93 public void checkInsert(Session session, Row row) 94 throws SQLException , IOException  95 { 96 } 97 98 public byte[] makeKey(Session session, Row row, long rowId) 99 throws SQLException  100 { 101 byte[] key = Key.makeKey(table, row, getColumns(), rowId, true); 102 return key; 103 } 104 105 public boolean isUnique() { return false; } 106 107 public int getIndexColumnCount() { 108 return getColumnCount() + 1; 109 } 110 111 public String toString() { 112 return "NonUniqueIndexConstraint: " + super.toString(); 113 } 114 115 public String constraintType() { return "non-unique index"; } 116 } 117 | Popular Tags |