1 21 22 package org.apache.derby.impl.sql.compile; 23 24 import org.apache.derby.vti.DeferModification; 25 26 30 class DefaultVTIModDeferPolicy implements DeferModification 31 { 32 private final String targetVTIClassName; 33 private final boolean VTIResultSetIsSensitive; 34 35 DefaultVTIModDeferPolicy( String targetVTIClassName, 36 boolean VTIResultSetIsSensitive) 37 { 38 this.targetVTIClassName = targetVTIClassName; 39 this.VTIResultSetIsSensitive = VTIResultSetIsSensitive; 40 } 41 42 45 public boolean alwaysDefer( int statementType) 46 { 47 return false; 48 } 49 50 53 public boolean columnRequiresDefer( int statementType, 54 String columnName, 55 boolean inWhereClause) 56 { 57 switch( statementType) 58 { 59 case DeferModification.INSERT_STATEMENT: 60 return false; 61 62 case DeferModification.UPDATE_STATEMENT: 63 return VTIResultSetIsSensitive && inWhereClause; 64 65 case DeferModification.DELETE_STATEMENT: 66 return false; 67 } 68 return false; } 71 74 public boolean subselectRequiresDefer( int statementType, 75 String schemaName, 76 String tableName) 77 { 78 return false; 79 } 81 84 public boolean subselectRequiresDefer( int statementType, 85 String VTIClassName) 86 { 87 return targetVTIClassName.equals( VTIClassName); 88 } 90 public void modificationNotify( int statementType, 91 boolean deferred) 92 {} 93 } 94 | Popular Tags |