1 21 22 package org.apache.derby.impl.sql; 23 24 import org.apache.derby.iapi.sql.execute.ExecCursorTableReference; 25 import org.apache.derby.iapi.services.sanity.SanityManager; 26 27 import org.apache.derby.iapi.services.io.StoredFormatIds; 28 import org.apache.derby.iapi.services.io.FormatIdUtil; 29 import org.apache.derby.iapi.services.io.Formatable; 30 31 import java.io.ObjectOutput ; 32 import java.io.ObjectInput ; 33 import java.io.IOException ; 34 38 public class CursorTableReference 39 implements ExecCursorTableReference, Formatable 40 { 41 42 55 56 private String exposedName; 57 private String baseName; 58 private String schemaName; 59 60 63 public CursorTableReference() 64 { 65 } 66 67 70 public CursorTableReference 71 ( 72 String exposedName, 73 String baseName, 74 String schemaName 75 ) 76 { 77 this.exposedName = exposedName; 78 this.baseName = baseName; 79 this.schemaName = schemaName; 80 } 81 82 87 public String getBaseName() 88 { 89 return baseName; 90 } 91 92 100 public String getExposedName() 101 { 102 return exposedName; 103 } 104 105 110 public String getSchemaName() 111 { 112 return schemaName; 113 } 114 115 127 public void writeExternal(ObjectOutput out) throws IOException 128 { 129 out.writeObject(baseName); 130 out.writeObject(exposedName); 131 out.writeObject(schemaName); 132 } 133 134 142 public void readExternal(ObjectInput in) 143 throws IOException , ClassNotFoundException 144 { 145 baseName = (String )in.readObject(); 146 exposedName = (String )in.readObject(); 147 schemaName = (String )in.readObject(); 148 } 149 150 155 public int getTypeFormatId() { return StoredFormatIds.CURSOR_TABLE_REFERENCE_V01_ID; } 156 157 public String toString() 158 { 159 if (SanityManager.DEBUG) 160 { 161 return "CursorTableReference"+ 162 "\n\texposedName: "+exposedName+ 163 "\n\tbaseName: "+baseName+ 164 "\n\tschemaName: "+schemaName; 165 } 166 else 167 { 168 return ""; 169 } 170 } 171 } 172 | Popular Tags |