Class SqlCacheDependency

  • All Implemented Interfaces:
    java.io.Serializable

    public final class SqlCacheDependency
    extends CacheDependency
    Establishes a relationship between an item stored in an application's Cache object and either a row in a specific SQL Server database table or the results of a SQL Server query.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SqlCacheDependency​(java.lang.String connectionString, java.lang.String cmdText)
      Initializes a new instance of the SqlCacheDependency class, using the supplied connection string and query string.
      SqlCacheDependency​(java.lang.String connectionString, java.lang.String cmdText, SqlCommandType cmdType, java.util.Map<java.lang.String,​SqlCmdParams> cmdParams)
      Initializes a new instance of the SqlCacheDependency class.
    • Constructor Detail

      • SqlCacheDependency

        public SqlCacheDependency​(java.lang.String connectionString,
                                  java.lang.String cmdText)
        Initializes a new instance of the SqlCacheDependency class, using the supplied connection string and query string.
        Parameters:
        connectionString - connection string to be used by dependency.
        cmdText - cmdText to be used by dependency.
      • SqlCacheDependency

        public SqlCacheDependency​(java.lang.String connectionString,
                                  java.lang.String cmdText,
                                  SqlCommandType cmdType,
                                  java.util.Map<java.lang.String,​SqlCmdParams> cmdParams)
        Initializes a new instance of the SqlCacheDependency class. It supports the use of 'Stored Procedures'.
        Parameters:
        connectionString - connection string to be used by dependency.
        cmdText - cmdText to be used by dependency.
        cmdType - The type of the command. (text/stored procedure)
        cmdParams - Parameters to be passed to the command.
    • Method Detail

      • getConnectionString

        public java.lang.String getConnectionString()
        The connection string that is required to the cache in order to connect with database.
        Returns:
        The connection string of the dependency.
      • getCommandText

        public java.lang.String getCommandText()
        CommandText(Query string) to be used by dependency.
        Returns:
        The commandText(Query string) of the dependency.
      • getCommandType

        public CommandType getCommandType()
        Gets the type of the Sql command passed to the SqlDependency.
        Returns:
        The type of sql command used for dependency.
      • getCommandParams

        public java.util.Map<java.lang.String,​SqlCmdParams> getCommandParams()
        Gets the sql command parameters passed to SqlCacheDependency.
        Returns:
        The sql command params of the dependency.