Top Description Fields Constructors Methods
org.h2.command.ddl

public Class GrantRevoke

extends DefineCommand
Class Inheritance
Imports
java.util.ArrayList, org.h2.api.ErrorCode, org.h2.command.CommandInterface, org.h2.engine.Database, .DbObject, .Right, .RightOwner, .Role, .SessionLocal, .User, org.h2.message.DbException, org.h2.schema.Schema, org.h2.table.Table, org.h2.util.Utils

This class represents the statements GRANT RIGHT, GRANT ROLE, REVOKE RIGHT, REVOKE ROLE

Field Summary

Modifier and TypeField and Description
private RightOwner
private int
private int
private ArrayList<String>
private Schema
private final ArrayList<Table>
Inherited from org.h2.command.ddl.DefineCommand:
transactional

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addRight(int
the right bit
right
)

Add the specified right bit to the rights bitmap.

public void
addRoleName(String
the role
roleName
)

Add the specified role to the list of roles.

public void
addTable(Table
the table
table
)

Add the specified table to the list of tables.

public int
getType()

Implements abstract org.h2.command.Prepared.getType.

Get the command type as defined in CommandInterface

private void
private void
private void
grantRole(Role grantedRole)

public boolean
isTransactional()

Overrides org.h2.command.ddl.DefineCommand.isTransactional.

Check if this command is transactional.

private void
private void
private void
revokeRole(Role grantedRole)

public void
setGranteeName(String granteeName)

public void
setOperationType(int operationType)

public void
setSchema(Schema
the schema
schema
)

Set the specified schema

public long
update()

Overrides org.h2.command.Prepared.update.

Execute the statement.

Inherited from org.h2.command.ddl.DefineCommand:
isReadOnlyisRetryablequeryMetasetTransactional

Field Detail

granteeback to summary
private RightOwner grantee
operationTypeback to summary
private int operationType
rightMaskback to summary
private int rightMask
roleNamesback to summary
private ArrayList<String> roleNames
schemaback to summary
private Schema schema
tablesback to summary
private final ArrayList<Table> tables

Constructor Detail

GrantRevokeback to summary
public GrantRevoke(SessionLocal session)

Method Detail

addRightback to summary
public void addRight(int right)

Add the specified right bit to the rights bitmap.

Parameters
right:int

the right bit

addRoleNameback to summary
public void addRoleName(String roleName)

Add the specified role to the list of roles.

Parameters
roleName:String

the role

addTableback to summary
public void addTable(Table table)

Add the specified table to the list of tables.

Parameters
table:Table

the table

getTypeback to summary
public int getType()

Implements abstract org.h2.command.Prepared.getType.

Doc from org.h2.command.Prepared.getType.

Get the command type as defined in CommandInterface

Returns:int

the statement type

Annotations
@Override
grantRightback to summary
private void grantRight()
grantRightback to summary
private void grantRight(DbObject object)
grantRoleback to summary
private void grantRole(Role grantedRole)
isTransactionalback to summary
public boolean isTransactional()

Overrides org.h2.command.ddl.DefineCommand.isTransactional.

Doc from org.h2.command.Prepared.isTransactional.

Check if this command is transactional. If it is not, then it forces the current transaction to commit.

Returns:boolean

true if it is

Annotations
@Override
revokeRightback to summary
private void revokeRight()
revokeRightback to summary
private void revokeRight(DbObject object)
revokeRoleback to summary
private void revokeRole(Role grantedRole)
setGranteeNameback to summary
public void setGranteeName(String granteeName)
setOperationTypeback to summary
public void setOperationType(int operationType)
setSchemaback to summary
public void setSchema(Schema schema)

Set the specified schema

Parameters
schema:Schema

the schema

updateback to summary
public long update()

Overrides org.h2.command.Prepared.update.

Doc from org.h2.command.Prepared.update.

Execute the statement.

Returns:long

the update count

Annotations
@Override