Package org.apache.derby.impl.sql.conn
Class SQLSessionContextImpl
java.lang.Object
org.apache.derby.impl.sql.conn.SQLSessionContextImpl
- All Implemented Interfaces:
SQLSessionContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionMaps a constraint id (key) into a Boolean for deferrable constraints.private SchemaDescriptor
private String
private String
private Boolean
True if all deferrable constraints are deferred in this transaction. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet a handle to the session's constraint modes.Get the SQL current user of this SQL connection contextGet the schema of this SQL connection contextGet state of DEFERRED ALL setting.getRole()
Get the SQL role of this SQL connection contextisDeferred
(UUID constraintId) ReturnBoolean.TRUE
if the constraint mode for this constraint/index has been set to deferred,Boolean.FALSE
if it has been set to immediate.void
Clear deferred information for this transaction.void
Initialize a inferior session context with the constraint mode map of the parent session context.void
Set the schema of this SQL connection contextvoid
setDeferred
(UUID constraintId, boolean deferred) Set the constraint mode for this constraint todeferred
.void
setDeferredAll
(Boolean deferred) Set the constraint mode for all deferrable constraints todeferred
.void
Set the SQL role of this SQL connection contextvoid
Set the SQL current user of this SQL connection context
-
Field Details
-
currentUser
-
currentRole
-
currentDefaultSchema
-
constraintModes
Maps a constraint id (key) into a Boolean for deferrable constraints. If the Boolean value isFALSE
, we have immediate checking, if it isTRUE
we have deferred checking. Cf. SQL SET CONSTRAINT. -
deferredAll
True if all deferrable constraints are deferred in this transaction.
-
-
Constructor Details
-
SQLSessionContextImpl
-
-
Method Details
-
setRole
Description copied from interface:SQLSessionContext
Set the SQL role of this SQL connection context- Specified by:
setRole
in interfaceSQLSessionContext
-
getRole
Description copied from interface:SQLSessionContext
Get the SQL role of this SQL connection context- Specified by:
getRole
in interfaceSQLSessionContext
-
setUser
Description copied from interface:SQLSessionContext
Set the SQL current user of this SQL connection context- Specified by:
setUser
in interfaceSQLSessionContext
-
getCurrentUser
Description copied from interface:SQLSessionContext
Get the SQL current user of this SQL connection context- Specified by:
getCurrentUser
in interfaceSQLSessionContext
-
setDefaultSchema
Description copied from interface:SQLSessionContext
Set the schema of this SQL connection context- Specified by:
setDefaultSchema
in interfaceSQLSessionContext
-
getDefaultSchema
Description copied from interface:SQLSessionContext
Get the schema of this SQL connection context- Specified by:
getDefaultSchema
in interfaceSQLSessionContext
-
getConstraintModes
Get a handle to the session's constraint modes. The caller is responsible for any cloning needed.- Specified by:
getConstraintModes
in interfaceSQLSessionContext
- Returns:
- constraint modes map
-
setConstraintModes
Initialize a inferior session context with the constraint mode map of the parent session context.- Specified by:
setConstraintModes
in interfaceSQLSessionContext
- Parameters:
hm
- constraint mode map
-
setDeferred
Set the constraint mode for this constraint todeferred
. Ifdeferred
isfalse
, to immediate checking, iftrue
to deferred checking.- Specified by:
setDeferred
in interfaceSQLSessionContext
- Parameters:
constraintId
- The constraint iddeferred
- The new constraint mode
-
isDeferred
ReturnBoolean.TRUE
if the constraint mode for this constraint/index has been set to deferred,Boolean.FALSE
if it has been set to immediate. Any ALL setting is considered also. If the constraint mode hasn't been set for this constraint, returnnull
. The constraint mode is the effectively the initial constraint mode in this case.- Specified by:
isDeferred
in interfaceSQLSessionContext
- Parameters:
constraintId
- the constraint id- Returns:
Boolean.TRUE
if the constraint mode for this constraint/index has been set to deferred,Boolean.FALSE
if it has been set to immediate.
-
resetConstraintModes
public void resetConstraintModes()Clear deferred information for this transaction.- Specified by:
resetConstraintModes
in interfaceSQLSessionContext
-
setDeferredAll
Set the constraint mode for all deferrable constraints todeferred
. Ifdeferred
isfalse
, set to immediate checking, iftrue
to deferred checking.null
is allowed: it means no ALL setting exists.- Specified by:
setDeferredAll
in interfaceSQLSessionContext
- Parameters:
deferred
- the mode to set
-
getDeferredAll
Get state of DEFERRED ALL setting.- Specified by:
getDeferredAll
in interfaceSQLSessionContext
- Returns:
True
is deferred all constraint mode has been set for this session context.False
is deferred immediate has been set for this session context.null
means no ALL setting has been made for this context
-