SQLSessionContext
public class SQLSessionContextImpl extends java.lang.Object implements SQLSessionContext
Modifier and Type | Field | Description |
---|---|---|
private java.util.HashMap<UUID,java.lang.Boolean> |
constraintModes |
Maps a constraint id (key) into a Boolean for deferrable
constraints.
|
private SchemaDescriptor |
currentDefaultSchema |
|
private java.lang.String |
currentRole |
|
private java.lang.String |
currentUser |
|
private java.lang.Boolean |
deferredAll |
True if all deferrable constraints are deferred in this transaction.
|
Constructor | Description |
---|---|
SQLSessionContextImpl(SchemaDescriptor sd,
java.lang.String currentUser) |
Modifier and Type | Method | Description |
---|---|---|
java.util.HashMap<UUID,java.lang.Boolean> |
getConstraintModes() |
Get a handle to the session's constraint modes.
|
java.lang.String |
getCurrentUser() |
Get the SQL current user of this SQL connection context
|
SchemaDescriptor |
getDefaultSchema() |
Get the schema of this SQL connection context
|
java.lang.Boolean |
getDeferredAll() |
Get state of DEFERRED ALL setting.
|
java.lang.String |
getRole() |
Get the SQL role of this SQL connection context
|
java.lang.Boolean |
isDeferred(UUID constraintId) |
Return
Boolean.TRUE if the constraint mode for this
constraint/index has been set to deferred, Boolean.FALSE if
it has been set to immediate. |
void |
resetConstraintModes() |
Clear deferred information for this transaction.
|
void |
setConstraintModes(java.util.HashMap<UUID,java.lang.Boolean> hm) |
Initialize a inferior session context with the constraint mode map
of the parent session context.
|
void |
setDefaultSchema(SchemaDescriptor sd) |
Set the schema of this SQL connection context
|
void |
setDeferred(UUID constraintId,
boolean deferred) |
Set the constraint mode for this constraint to
deferred . |
void |
setDeferredAll(java.lang.Boolean deferred) |
Set the constraint mode for all deferrable constraints to
deferred . |
void |
setRole(java.lang.String role) |
Set the SQL role of this SQL connection context
|
void |
setUser(java.lang.String user) |
Set the SQL current user of this SQL connection context
|
private java.lang.String currentUser
private java.lang.String currentRole
private SchemaDescriptor currentDefaultSchema
private java.util.HashMap<UUID,java.lang.Boolean> constraintModes
FALSE
, we have immediate
checking, if it is TRUE
we have deferred checking. Cf. SQL
SET CONSTRAINT.private java.lang.Boolean deferredAll
public SQLSessionContextImpl(SchemaDescriptor sd, java.lang.String currentUser)
public void setRole(java.lang.String role)
SQLSessionContext
setRole
in interface SQLSessionContext
public java.lang.String getRole()
SQLSessionContext
getRole
in interface SQLSessionContext
public void setUser(java.lang.String user)
SQLSessionContext
setUser
in interface SQLSessionContext
public java.lang.String getCurrentUser()
SQLSessionContext
getCurrentUser
in interface SQLSessionContext
public void setDefaultSchema(SchemaDescriptor sd)
SQLSessionContext
setDefaultSchema
in interface SQLSessionContext
public SchemaDescriptor getDefaultSchema()
SQLSessionContext
getDefaultSchema
in interface SQLSessionContext
public java.util.HashMap<UUID,java.lang.Boolean> getConstraintModes()
getConstraintModes
in interface SQLSessionContext
public void setConstraintModes(java.util.HashMap<UUID,java.lang.Boolean> hm)
setConstraintModes
in interface SQLSessionContext
hm
- constraint mode mappublic void setDeferred(UUID constraintId, boolean deferred)
deferred
.
If deferred
is false
, to immediate checking,
if true
to deferred checking.setDeferred
in interface SQLSessionContext
constraintId
- The constraint iddeferred
- The new constraint modepublic java.lang.Boolean isDeferred(UUID constraintId)
Boolean.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,
return null
. The constraint mode is the effectively the initial
constraint mode in this case.isDeferred
in interface SQLSessionContext
constraintId
- the constraint idBoolean.TRUE
if the constraint mode for this
constraint/index has been set to deferred, Boolean.FALSE
if
it has been set to immediate.public void resetConstraintModes()
resetConstraintModes
in interface SQLSessionContext
public void setDeferredAll(java.lang.Boolean deferred)
deferred
.
If deferred
is false
, set to immediate checking,
if true
to deferred checking.
null
is allowed: it means no ALL setting exists.setDeferredAll
in interface SQLSessionContext
deferred
- the mode to setpublic java.lang.Boolean getDeferredAll()
getDeferredAll
in interface SQLSessionContext
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 contextApache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.