1 21 22 package org.apache.derby.impl.sql.catalog; 23 24 import org.apache.derby.iapi.error.StandardException; 25 import org.apache.derby.iapi.reference.Limits; 26 import org.apache.derby.iapi.services.uuid.UUIDFactory; 27 import org.apache.derby.iapi.sql.dictionary.CatalogRowFactory; 28 import org.apache.derby.iapi.sql.dictionary.PermissionsDescriptor; 29 import org.apache.derby.iapi.sql.execute.ExecIndexRow; 30 import org.apache.derby.iapi.sql.execute.ExecRow; 31 import org.apache.derby.iapi.sql.execute.ExecutionFactory; 32 import org.apache.derby.iapi.types.DataValueDescriptor; 33 import org.apache.derby.iapi.types.DataValueFactory; 34 import org.apache.derby.iapi.types.RowLocation; 35 import org.apache.derby.iapi.types.StringDataValue; 36 37 abstract class PermissionsCatalogRowFactory extends CatalogRowFactory 38 { 39 static final String AUTHORIZATION_ID_TYPE = "VARCHAR"; 40 static final boolean AUTHORIZATION_ID_IS_BUILTIN_TYPE = true; 41 static final int AUTHORIZATION_ID_LENGTH = Limits.MAX_IDENTIFIER_LENGTH; 42 43 PermissionsCatalogRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf, 44 boolean convertIdToLower) 45 { 46 super(uuidf,ef,dvf,convertIdToLower); 47 } 48 49 DataValueDescriptor getAuthorizationID( String value) 50 { 51 return getDataValueFactory().getVarcharDataValue( value); 52 } 53 54 DataValueDescriptor getNullAuthorizationID() 55 { 56 return getDataValueFactory().getNullVarchar( (StringDataValue) null); 57 } 58 59 67 String getAuthorizationID( ExecRow row, int columnPos) 68 throws StandardException 69 { 70 return row.getColumn( columnPos).getString(); 71 } 72 73 81 abstract ExecIndexRow buildIndexKeyRow( int indexNumber, 82 PermissionsDescriptor perm) 83 throws StandardException; 84 85 97 abstract int orPermissions( ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged) 98 throws StandardException; 99 100 112 abstract int removePermissions( ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged) 113 throws StandardException; 114 115 125 abstract void setUUIDOfThePassedDescriptor(ExecRow row, PermissionsDescriptor perm) throws StandardException; 126 } 127 | Popular Tags |