1 21 22 package org.apache.derby.impl.sql.compile; 23 24 import org.apache.derby.iapi.services.loader.ClassFactory; 25 26 import org.apache.derby.iapi.error.StandardException; 27 28 import org.apache.derby.iapi.types.TypeId; 29 import org.apache.derby.iapi.types.DataTypeDescriptor; 30 import org.apache.derby.iapi.types.DataTypeDescriptor; 31 import org.apache.derby.iapi.types.DataValueFactory; 32 33 import org.apache.derby.iapi.types.RefDataValue; 34 35 import org.apache.derby.iapi.sql.compile.TypeCompiler; 36 37 import org.apache.derby.iapi.services.sanity.SanityManager; 38 39 import org.apache.derby.iapi.reference.ClassName; 40 41 46 47 public class RefTypeCompiler extends BaseTypeCompiler 48 { 49 50 public String getCorrespondingPrimitiveTypeName() 51 { 52 if (SanityManager.DEBUG) 53 SanityManager.THROWASSERT("getCorrespondingPrimitiveTypeName not implemented for SQLRef"); 54 return null; 55 } 56 57 60 public int getCastToCharWidth(DataTypeDescriptor dts) 61 { 62 if (SanityManager.DEBUG) 63 SanityManager.THROWASSERT( "getCastToCharWidth not implemented for SQLRef"); 64 return 0; 65 } 66 67 68 public boolean convertible(TypeId otherType, 69 boolean forDataTypeFunction) 70 { 71 return false; 72 } 73 74 78 public boolean compatible(TypeId otherType) 79 { 80 return convertible(otherType,false); 81 } 82 83 84 85 public boolean comparable(TypeId otherType, 86 boolean forEquals, 87 ClassFactory cf) 88 { 89 return false; 90 } 91 92 93 public boolean storable(TypeId otherType, ClassFactory cf) 94 { 95 return otherType.isRefTypeId(); 96 } 97 98 99 public String interfaceName() 100 { 101 return ClassName.RefDataValue; 102 } 103 104 protected String nullMethodName() 105 { 106 return "getNullRef"; 107 } 108 } 109 | Popular Tags |