org.h2.engine
Class Right

java.lang.Object
  extended by org.h2.engine.DbObjectBase
      extended by org.h2.engine.Right
All Implemented Interfaces:
DbObject

public class Right
extends DbObjectBase

An access right. Rights are regular database objects, but have generated names.


Field Summary
static int ALL
          The right bit mask that means: select, insert, update, delete, and update for this object is allowed.
static int DELETE
          The right bit mask that means: deleting rows from a table is allowed.
static int INSERT
          The right bit mask that means: inserting rows into a table is allowed.
static int SELECT
          The right bit mask that means: selecting from a table is allowed.
static int UPDATE
          The right bit mask that means: updating data is allowed.
 
Fields inherited from class org.h2.engine.DbObjectBase
comment, database, trace
 
Fields inherited from interface org.h2.engine.DbObject
AGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE
 
Constructor Summary
Right(Database db, int id, RightOwner grantee, int grantedRight, Table grantedRightOnTable)
           
Right(Database db, int id, RightOwner grantee, Role grantedRole)
           
 
Method Summary
 void checkRename()
          Check if this object can be renamed.
 java.lang.String getCreateSQL()
          Build a SQL statement to re-create this object.
 java.lang.String getCreateSQLForCopy(Table table, java.lang.String quotedName)
          Build a SQL statement to re-create the object, or to create a copy of the object with a different name or referencing a different table
 java.lang.String getDropSQL()
          Build a SQL statement to drop this object.
 Role getGrantedRole()
           
 Table getGrantedTable()
           
 DbObject getGrantee()
           
 int getRightMask()
           
 java.lang.String getRights()
           
 int getType()
          Get the object type.
 void removeChildrenAndResources(Session session)
          Remove all dependent objects and free all resources (files, blocks in files) of this object.
 void setRightMask(int rightMask)
           
 
Methods inherited from class org.h2.engine.DbObjectBase
getChildren, getComment, getDatabase, getHeadPos, getId, getModificationId, getName, getSQL, initDbObjectBase, invalidate, isTemporary, rename, setComment, setModified, setObjectName, setTemporary, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SELECT

public static final int SELECT
The right bit mask that means: selecting from a table is allowed.

See Also:
Constant Field Values

DELETE

public static final int DELETE
The right bit mask that means: deleting rows from a table is allowed.

See Also:
Constant Field Values

INSERT

public static final int INSERT
The right bit mask that means: inserting rows into a table is allowed.

See Also:
Constant Field Values

UPDATE

public static final int UPDATE
The right bit mask that means: updating data is allowed.

See Also:
Constant Field Values

ALL

public static final int ALL
The right bit mask that means: select, insert, update, delete, and update for this object is allowed.

See Also:
Constant Field Values
Constructor Detail

Right

public Right(Database db,
             int id,
             RightOwner grantee,
             Role grantedRole)

Right

public Right(Database db,
             int id,
             RightOwner grantee,
             int grantedRight,
             Table grantedRightOnTable)
Method Detail

getRights

public java.lang.String getRights()

getGrantedRole

public Role getGrantedRole()

getGrantedTable

public Table getGrantedTable()

getGrantee

public DbObject getGrantee()

getDropSQL

public java.lang.String getDropSQL()
Description copied from class: DbObjectBase
Build a SQL statement to drop this object.

Specified by:
getDropSQL in interface DbObject
Specified by:
getDropSQL in class DbObjectBase
Returns:
the SQL statement

getCreateSQLForCopy

public java.lang.String getCreateSQLForCopy(Table table,
                                            java.lang.String quotedName)
Description copied from class: DbObjectBase
Build a SQL statement to re-create the object, or to create a copy of the object with a different name or referencing a different table

Specified by:
getCreateSQLForCopy in interface DbObject
Specified by:
getCreateSQLForCopy in class DbObjectBase
Parameters:
table - the new table name
quotedName - the new quoted name
Returns:
the SQL statement

getCreateSQL

public java.lang.String getCreateSQL()
Description copied from class: DbObjectBase
Build a SQL statement to re-create this object.

Specified by:
getCreateSQL in interface DbObject
Specified by:
getCreateSQL in class DbObjectBase
Returns:
the SQL statement

getType

public int getType()
Description copied from class: DbObjectBase
Get the object type.

Specified by:
getType in interface DbObject
Specified by:
getType in class DbObjectBase
Returns:
the object type

removeChildrenAndResources

public void removeChildrenAndResources(Session session)
                                throws java.sql.SQLException
Description copied from class: DbObjectBase
Remove all dependent objects and free all resources (files, blocks in files) of this object.

Specified by:
removeChildrenAndResources in interface DbObject
Specified by:
removeChildrenAndResources in class DbObjectBase
Parameters:
session - the session
Throws:
java.sql.SQLException

checkRename

public void checkRename()
Description copied from class: DbObjectBase
Check if this object can be renamed. System objects may not be renamed.

Specified by:
checkRename in interface DbObject
Specified by:
checkRename in class DbObjectBase

setRightMask

public void setRightMask(int rightMask)

getRightMask

public int getRightMask()