Class SQLSessionContextImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • currentUser

        private java.lang.String currentUser
      • currentRole

        private java.lang.String currentRole
      • constraintModes

        private java.util.HashMap<UUID,​java.lang.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.
      • deferredAll

        private java.lang.Boolean deferredAll
        True if all deferrable constraints are deferred in this transaction.
    • Constructor Detail

      • SQLSessionContextImpl

        public SQLSessionContextImpl​(SchemaDescriptor sd,
                                     java.lang.String currentUser)
    • Method Detail

      • setRole

        public void setRole​(java.lang.String role)
        Description copied from interface: SQLSessionContext
        Set the SQL role of this SQL connection context
        Specified by:
        setRole in interface SQLSessionContext
      • setUser

        public void setUser​(java.lang.String user)
        Description copied from interface: SQLSessionContext
        Set the SQL current user of this SQL connection context
        Specified by:
        setUser in interface SQLSessionContext
      • getConstraintModes

        public java.util.HashMap<UUID,​java.lang.Boolean> getConstraintModes()
        Get a handle to the session's constraint modes. The caller is responsible for any cloning needed.
        Specified by:
        getConstraintModes in interface SQLSessionContext
        Returns:
        constraint modes map
      • setConstraintModes

        public 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.
        Specified by:
        setConstraintModes in interface SQLSessionContext
        Parameters:
        hm - constraint mode map
      • setDeferred

        public void setDeferred​(UUID constraintId,
                                boolean deferred)
        Set the constraint mode for this constraint to deferred. If deferred is false, to immediate checking, if true to deferred checking.
        Specified by:
        setDeferred in interface SQLSessionContext
        Parameters:
        constraintId - The constraint id
        deferred - The new constraint mode
      • isDeferred

        public 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. 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.
        Specified by:
        isDeferred in interface SQLSessionContext
        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.
      • setDeferredAll

        public void setDeferredAll​(java.lang.Boolean deferred)
        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.
        Specified by:
        setDeferredAll in interface SQLSessionContext
        Parameters:
        deferred - the mode to set
      • getDeferredAll

        public java.lang.Boolean getDeferredAll()
        Get state of DEFERRED ALL setting.
        Specified by:
        getDeferredAll in interface SQLSessionContext
        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