Interface IPrivilege

All Superinterfaces:
IHashable
All Known Implementing Classes:
AbstractPrivilege, ChPrivilege, MsPrivilege, PgPrivilege

public interface IPrivilege extends IHashable
Represents a database privilege (GRANT/REVOKE) for a database object. Handles privilege operations including creation, dropping, and SQL generation.
  • Field Details

  • Method Details

    • isRevoke

      boolean isRevoke()
      Checks if this privilege represents a REVOKE operation.
      Returns:
      true if this is a REVOKE privilege, false if GRANT
    • getCreationSQL

      String getCreationSQL()
      Generates the SQL statement for this privilege.
      Returns:
      the GRANT or REVOKE SQL statement
    • getDropSQL

      String getDropSQL()
      Generates the SQL statement to drop this privilege.
      Returns:
      the REVOKE SQL statement, or null if this is already a REVOKE
    • getPermission

      String getPermission()
      Returns:
      the permission type (e.g., SELECT, INSERT, ALL)
    • getRole

      String getRole()
      Returns:
      role the role receiving or losing the privilege
    • getName

      String getName()
      Returns:
      the object name the privilege applies to
    • appendPrivileges

      static void appendPrivileges(Collection<IPrivilege> privileges, SQLScript script)
      Appends multiple privileges to a SQL script.
      Parameters:
      privileges - the collection of privileges to append
      script - the script to append to