1 package org.apache.turbine.om.security.peer; 2 3 18 19 import org.apache.torque.util.BasePeer; 20 import org.apache.torque.util.Criteria; 21 import org.apache.turbine.util.db.map.TurbineMapBuilder; 22 23 34 public class RolePermissionPeer extends BasePeer 35 { 36 37 private static final TurbineMapBuilder MAP_BUILDER = (TurbineMapBuilder) 38 getMapBuilder(TurbineMapBuilder.class.getName()); 39 40 41 public static final String TABLE_NAME = MAP_BUILDER.getTableRolePermission(); 42 43 44 public static final String PERMISSION_ID 45 = MAP_BUILDER.getRolePermission_PermissionId(); 46 47 48 public static final String ROLE_ID = MAP_BUILDER.getRolePermission_RoleId(); 49 50 51 57 public static void deleteRole(int role_id) throws Exception 58 { 59 Criteria criteria = new Criteria(); 60 criteria.add(ROLE_ID, role_id); 61 doDelete(criteria); 62 } 63 64 70 public static void deletePermission(int permission_id) throws Exception 71 { 72 Criteria criteria = new Criteria(); 73 criteria.add(PERMISSION_ID, permission_id); 74 doDelete(criteria); 75 } 76 } 77 | Popular Tags |