public TablePermsDescriptor newTablePermsDescriptor( TableDescriptor td, String selectPerm, String deletePerm, String insertPerm, String updatePerm, String referencesPerm, String triggerPerm, String grantor) throws StandardException { if ("N".equals(selectPerm) && "N".equals(deletePerm) && "N".equals(insertPerm) && "N".equals(updatePerm) && "N".equals(referencesPerm) && "N".equals(triggerPerm)) return null; return new TablePermsDescriptor( dataDictionary, (String) null, grantor, td.getUUID(), selectPerm, deletePerm, insertPerm, updatePerm, referencesPerm, triggerPerm); }
/** * Constructor. Used when creating a trigger from SYS.SYSTRIGGERS * * @param dataDictionary the data dictionary * @param sd the schema descriptor for this trigger * @param id the trigger id * @param name the trigger name * @param eventMask TriggerDescriptor.TRIGGER_EVENT_XXXX * @param isBefore is this a before (as opposed to after) trigger * @param isRow is this a row trigger or statement trigger * @param isEnabled is this trigger enabled or disabled * @param td the table upon which this trigger is defined * @param whenSPSId the sps id for the when clause (may be null) * @param actionSPSId the spsid for the trigger action (may be null) * @param creationTimestamp when was this trigger created? * @param referencedCols what columns does this trigger reference (may be null) * @param triggerDefinition The original user text of the trigger action * @param referencingOld whether or not OLD appears in REFERENCING clause * @param referencingNew whether or not NEW appears in REFERENCING clause * @param oldReferencingName old referencing table name, if any, that appears in REFERCING clause * @param newReferencingName new referencing table name, if any, that appears in REFERCING clause */ public TriggerDescriptor( DataDictionary dataDictionary, SchemaDescriptor sd, UUID id, String name, int eventMask, boolean isBefore, boolean isRow, boolean isEnabled, TableDescriptor td, UUID whenSPSId, UUID actionSPSId, Timestamp creationTimestamp, int[] referencedCols, String triggerDefinition, boolean referencingOld, boolean referencingNew, String oldReferencingName, String newReferencingName) { super(dataDictionary); this.id = id; this.sd = sd; this.name = name; this.eventMask = eventMask; this.isBefore = isBefore; this.isRow = isRow; this.td = td; this.actionSPSId = actionSPSId; this.whenSPSId = whenSPSId; this.isEnabled = isEnabled; this.referencedCols = referencedCols; this.creationTimestamp = creationTimestamp; this.triggerDefinition = triggerDefinition; this.referencingOld = referencingOld; this.referencingNew = referencingNew; this.oldReferencingName = oldReferencingName; this.newReferencingName = newReferencingName; triggerSchemaId = sd.getUUID(); triggerTableId = td.getUUID(); }
/** * Manufacture a new ColPermsDescriptor. * * @param td The descriptor of the table. * @param type The action type: * <ol> * <li>"s" - select without grant * <li>"S" - select with grant * <li>"u" - update without grant * <li>"U" - update with grant * <li>"r" - references without grant * <li>"R" - references with grant * </ol> * * @param columns the set of columns */ public ColPermsDescriptor newColPermsDescriptor( TableDescriptor td, String type, FormatableBitSet columns, String grantor) throws StandardException { return new ColPermsDescriptor( dataDictionary, (String) null, grantor, td.getUUID(), type, columns); }