Top Fields Constructors Methods
org.apache.derby.impl.sql.conn

public Class SQLSessionContextImpl

extends Object
implements SQLSessionContext
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.conn.SQLSessionContext
Imports
java.util.HashMap, org.apache.derby.catalog.UUID, org.apache.derby.iapi.sql.conn.SQLSessionContext, org.apache.derby.iapi.sql.dictionary.SchemaDescriptor

Field Summary

Modifier and TypeField and Description
private HashMap<UUID, Boolean>
constraintModes

Maps a constraint id (key) into a Boolean for deferrable constraints.

private SchemaDescriptor
private String
private String
private Boolean
deferredAll

True if all deferrable constraints are deferred in this transaction.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public HashMap<UUID, Boolean>
getConstraintModes()

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.getConstraintModes.

Get a handle to the session's constraint modes.

public String
getCurrentUser()

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.getCurrentUser.

Get the SQL current user of this SQL connection context

public SchemaDescriptor
getDefaultSchema()

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.getDefaultSchema.

Get the schema of this SQL connection context

public Boolean
public String
getRole()

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.getRole.

Get the SQL role of this SQL connection context

public Boolean
isDeferred(UUID
the constraint id
constraintId
)

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.isDeferred.

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.

public void
resetConstraintModes()

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.resetConstraintModes.

Clear deferred information for this transaction.

public void
setConstraintModes(HashMap<UUID, Boolean>
constraint mode map
hm
)

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.setConstraintModes.

Initialize a inferior session context with the constraint mode map of the parent session context.

public void
public void
setDeferred(UUID
The constraint id
constraintId
,
boolean
The new constraint mode
deferred
)

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.setDeferred.

Set the constraint mode for this constraint to deferred.

public void
setDeferredAll(Boolean
the mode to set
deferred
)

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.setDeferredAll.

Set the constraint mode for all deferrable constraints to deferred.

public void
setRole(String role)

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.setRole.

Set the SQL role of this SQL connection context

public void
setUser(String user)

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.setUser.

Set the SQL current user of this SQL connection context

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

constraintModesback to summary
private HashMap<UUID, Boolean> constraintModes

Maps a constraint id (key) into a Boolean for deferrable constraints. If the Boolean value is FALSE, we have immediate checking, if it is TRUE we have deferred checking. Cf. SQL SET CONSTRAINT.

currentDefaultSchemaback to summary
private SchemaDescriptor currentDefaultSchema
currentRoleback to summary
private String currentRole
currentUserback to summary
private String currentUser
deferredAllback to summary
private Boolean deferredAll

True if all deferrable constraints are deferred in this transaction.

Constructor Detail

SQLSessionContextImplback to summary
public SQLSessionContextImpl(SchemaDescriptor sd, String currentUser)

Method Detail

getConstraintModesback to summary
public HashMap<UUID, Boolean> getConstraintModes()

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.getConstraintModes.

Doc from org.apache.derby.iapi.sql.conn.SQLSessionContext.getConstraintModes.

Get a handle to the session's constraint modes. The caller is responsible for any cloning needed.

Returns:HashMap<UUID, Boolean>

constraint modes map

getCurrentUserback to summary
public String getCurrentUser()

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.getCurrentUser.

Doc from org.apache.derby.iapi.sql.conn.SQLSessionContext.getCurrentUser.

Get the SQL current user of this SQL connection context

getDefaultSchemaback to summary
public SchemaDescriptor getDefaultSchema()

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.getDefaultSchema.

Doc from org.apache.derby.iapi.sql.conn.SQLSessionContext.getDefaultSchema.

Get the schema of this SQL connection context

getDeferredAllback to summary
public Boolean getDeferredAll()

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.getDeferredAll.

Doc from org.apache.derby.iapi.sql.conn.SQLSessionContext.getDeferredAll.

Get state of DEFERRED ALL setting.

Returns:Boolean

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

getRoleback to summary
public String getRole()

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.getRole.

Doc from org.apache.derby.iapi.sql.conn.SQLSessionContext.getRole.

Get the SQL role of this SQL connection context

isDeferredback to summary
public Boolean isDeferred(UUID constraintId)

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.isDeferred.

Doc from org.apache.derby.iapi.sql.conn.SQLSessionContext.isDeferred.

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. 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.

Parameters
constraintId:UUID

the constraint id

Returns:Boolean

Boolean.TRUE if the constraint mode for this constraint/index has been set to deferred, Boolean.FALSE if it has been set to immediate.

resetConstraintModesback to summary
public void resetConstraintModes()

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.resetConstraintModes.

Doc from org.apache.derby.iapi.sql.conn.SQLSessionContext.resetConstraintModes.

Clear deferred information for this transaction.

setConstraintModesback to summary
public void setConstraintModes(HashMap<UUID, Boolean> hm)

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.setConstraintModes.

Doc from org.apache.derby.iapi.sql.conn.SQLSessionContext.setConstraintModes.

Initialize a inferior session context with the constraint mode map of the parent session context.

Parameters
hm:HashMap<UUID, Boolean>

constraint mode map

setDefaultSchemaback to summary
public void setDefaultSchema(SchemaDescriptor sd)

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.setDefaultSchema.

Doc from org.apache.derby.iapi.sql.conn.SQLSessionContext.setDefaultSchema.

Set the schema of this SQL connection context

setDeferredback to summary
public void setDeferred(UUID constraintId, boolean deferred)

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.setDeferred.

Doc from org.apache.derby.iapi.sql.conn.SQLSessionContext.setDeferred.

Set the constraint mode for this constraint to deferred. If deferred is false, to immediate checking, if true to deferred checking.

Parameters
constraintId:UUID

The constraint id

deferred:boolean

The new constraint mode

setDeferredAllback to summary
public void setDeferredAll(Boolean deferred)

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.setDeferredAll.

Doc from org.apache.derby.iapi.sql.conn.SQLSessionContext.setDeferredAll.

Set the constraint mode for all deferrable constraints to deferred. If deferred is false, set to immediate checking, if true to deferred checking. null is allowed: it means no ALL setting exists.

Parameters
deferred:Boolean

the mode to set

setRoleback to summary
public void setRole(String role)

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.setRole.

Doc from org.apache.derby.iapi.sql.conn.SQLSessionContext.setRole.

Set the SQL role of this SQL connection context

setUserback to summary
public void setUser(String user)

Implements org.apache.derby.iapi.sql.conn.SQLSessionContext.setUser.

Doc from org.apache.derby.iapi.sql.conn.SQLSessionContext.setUser.

Set the SQL current user of this SQL connection context