Class SqlStandardControl

    • Field Detail

      • staticInputValues

        private Object staticInputValues
        The object used for the SQL statement dynamic input values. The class of this object is also named as the input class or the dynamic parameters class. The exact class type isn't important, all the parameters settled into the SQL prepared statement are picked up using the reflection API.
      • dynamicUpdateValues

        private Object dynamicUpdateValues
        The object used for the SQL update statement dynamic input values. This enables to split input values into value used for WHERE fragment and for UPDATE fragment of the SQL statement. In the case this parameter is null, the dynamicInputValues parameter for SqlCrudEngine.update(SqlSession, Object, SqlControl) holds all input values.
      • maxTimeout

        private Integer maxTimeout
        The max SQL execution time. This parameter can help to protect production system against ineffective SQL query commands. The value is in milliseconds.
      • firstResult

        private Integer firstResult
        The first SQL execution output row to be returned in the case we need to skip some rows in the result set. The primary usage is to support the pagination.
      • maxResults

        private Integer maxResults
        The max number of SQL execution output rows, which can be returned in the result list. The primary usage is to support the pagination.
      • order

        private SqlOrder order
        The ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.
      • moreResultClasses

        private Map<String,​Class<?>> moreResultClasses
        More result classes used for the return values, like the collections classes or the collections items. They are used mainly for the one-to-one, one-to-many and many-to-many associations.
      • features

        private Map<String,​Object> features
        The optional features. These features are defined in the statement execution scope. In the case of conflict with the optional features defined in sthe statement/global scope, their priority is higher.
      • fetchSize

        private Integer fetchSize
        Returns the fetch size of SQL execution output rows, which can be returned in one SQL statement.
      • skipEmptyStatement

        private Boolean skipEmptyStatement
        The indicator, that an empty INSERT or UPDATE statement execution should be ignored (for example update statement without any bounded input values).
      • lowLevelSqlCallback

        private SqlControl.LowLevelSqlCallback lowLevelSqlCallback
        The low level SQL callback handler. Enables the input values and the final SQL command modification before the required database command execution. Enables the output values modification after the required database command execution.
      • sqlExecutionCallback

        private SqlControl.SqlExecutionCallback sqlExecutionCallback
        The SQL command execution callback handler. Enables the input values and the final SQL command modification before the required database command execution. Enables the output values modification after the required database command execution.
      • sqlName

        private String sqlName
        The name of the required SQL Query Engine instance. It can be used in the case the name is to be chosen in the runtime.
    • Constructor Detail

      • SqlStandardControl

        public SqlStandardControl()
        Standard constructor.
      • SqlStandardControl

        public SqlStandardControl​(SqlControl sqlControl)
        Merging constructor.
    • Method Detail

      • getStaticInputValues

        public Object getStaticInputValues()
        Returns the object used for the SQL statement static input values. The class of this object is also named as the input class or the static parameters class. The exact class type isn't important, all the parameters injected into the SQL query command are picked up using the reflection API. Compared to dynamicInputValues input parameters, parameters in this class should't be produced by an end user to prevent SQL injection threat!
        Specified by:
        getStaticInputValues in interface SqlControl
        Returns:
        the object used for the SQL statement static input values
      • setStaticInputValues

        public SqlStandardControl setStaticInputValues​(Object staticInputValues)
        Sets the object used for the SQL statement static input values. The class of this object is also named as the input class or the static parameters class. The exact class type isn't important, all the parameters injected into the SQL query command are picked up using the reflection API. Compared to dynamicInputValues input parameters, parameters in this class should't be produced by an end user to prevent SQL injection threat!
        Parameters:
        staticInputValues - the object used for the SQL statement static input values
        Returns:
        this instance
      • getDynamicUpdateValues

        public Object getDynamicUpdateValues()
        The object used for the SQL update statement dynamic input values. This enables to split input values into value used for WHERE fragment and for UPDATE fragment of the SQL statement. In the case this parameter is null, the dynamicInputValues parameter for SqlCrudEngine.update(SqlSession, Object, SqlControl) holds all input values.
        Specified by:
        getDynamicUpdateValues in interface SqlControl
        Returns:
        the object used for the SQL update statement dynamic input values (UPDATE fragment)
      • setDynamicUpdateValues

        public SqlStandardControl setDynamicUpdateValues​(Object dynamicUpdateValues)
        Sets the object used for the SQL update statement dynamic input values. This enables to split input values into value used for WHERE fragment and for UPDATE fragment of the SQL statement. In the case this parameter is null, the dynamicInputValues parameter for SqlCrudEngine.update(SqlSession, Object, SqlControl) holds all input values.
        Parameters:
        dynamicUpdateValues - the object used for the SQL update statement dynamic input values (UPDATE fragment)
        Returns:
        this instance
      • getMaxTimeout

        public Integer getMaxTimeout()
        Returns the max SQL execution time. This parameter can help to protect production system against ineffective SQL query commands. The value is in milliseconds.
        Specified by:
        getMaxTimeout in interface SqlControl
        Returns:
        the max SQL execution time
      • setMaxTimeout

        public SqlStandardControl setMaxTimeout​(Integer maxTimeout)
        Sets the max SQL execution time. This parameter can help to protect production system against ineffective SQL query commands. The value is in milliseconds.
        Parameters:
        maxTimeout - the max SQL execution time
        Returns:
        this instance
      • getFirstResult

        public Integer getFirstResult()
        Returns the first SQL execution output row to be returned in the case we need to skip some rows in the result set. The primary usage is to support the pagination.
        Specified by:
        getFirstResult in interface SqlControl
        Returns:
        the first SQL execution output row
      • setFirstResult

        public SqlStandardControl setFirstResult​(Integer firstResult)
        Sets the first SQL execution output row to be returned in the case we need to skip some rows in the result set. The primary usage is to support the pagination.
        Parameters:
        firstResult - the first SQL execution output row
        Returns:
        this instance
      • getMaxResults

        public Integer getMaxResults()
        Returns the max number of SQL execution output rows, which can be returned in the result list. The primary usage is to support the pagination.
        Specified by:
        getMaxResults in interface SqlControl
        Returns:
        the max number of SQL execution output rows
      • setMaxResults

        public SqlStandardControl setMaxResults​(Integer maxResults)
        Sets the max number of SQL execution output rows, which can be returned in the result list. The primary usage is to support the pagination.
        Parameters:
        maxResults - the max number of SQL execution output rows
        Returns:
        this instance
      • getOrder

        public SqlOrder getOrder()
        Returns the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.
        Specified by:
        getOrder in interface SqlControl
        Returns:
        the ordering directive list
      • setOrder

        public SqlStandardControl setOrder​(SqlOrder order)
        Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.
        Parameters:
        order - the ordering directive list
        Returns:
        this instance
      • setAscOrder

        public SqlStandardControl setAscOrder​(int order)
        Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.
        Parameters:
        order - the ordering directive
        Returns:
        this instance
      • setAscOrderNullsLast

        public SqlStandardControl setAscOrderNullsLast​(int order)
        Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.
        Parameters:
        order - the ordering directive
        Returns:
        this instance
      • setAscOrder

        public SqlStandardControl setAscOrder​(String order)
        Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.
        Parameters:
        order - the ordering directive
        Returns:
        this instance
      • setAscOrderNullsLast

        public SqlStandardControl setAscOrderNullsLast​(String order)
        Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.
        Parameters:
        order - the ordering directive
        Returns:
        this instance
      • setDescOrder

        public SqlStandardControl setDescOrder​(int order)
        Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.
        Parameters:
        order - the ordering directive
        Returns:
        this instance
      • setDescOrderNullsFirst

        public SqlStandardControl setDescOrderNullsFirst​(int order)
        Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.
        Parameters:
        order - the ordering directive
        Returns:
        this instance
      • setDescOrder

        public SqlStandardControl setDescOrder​(String order)
        Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.
        Parameters:
        order - the ordering directive
        Returns:
        this instance
      • setDescOrderNullsFirst

        public SqlStandardControl setDescOrderNullsFirst​(String order)
        Sets the ordering directive list. Using the class SqlOrder the ordering rules can be chained. Every ordering rule in this chain should correspond to one META SQL ordering statement.
        Parameters:
        order - the ordering directive
        Returns:
        this instance
      • getMoreResultClasses

        public Map<String,​Class<?>> getMoreResultClasses()
        Returns more result classes used for the return values, like the collections classes or the collections items. They are used mainly for the one-to-one, one-to-many and many-to-many associations.
        Specified by:
        getMoreResultClasses in interface SqlControl
        Returns:
        more result classes used for the return values
      • setMoreResultClasses

        public SqlStandardControl setMoreResultClasses​(Map<String,​Class<?>> moreResultClasses)
        Sets more result classes used for the return values, like the collections classes or the collections items. They are used mainly for the one-to-one, one-to-many and many-to-many associations.
        Parameters:
        moreResultClasses - more result classes used for the return values
        Returns:
        this instance
      • getFeatures

        public Map<String,​Object> getFeatures()
        Returns the optional features. These features are defined in the statement execution scope. In the case of conflict with the optional features defined in sthe statement/global scope, their priority is higher.
        Specified by:
        getFeatures in interface SqlControl
        Returns:
        the optional features
      • setFeatures

        public SqlStandardControl setFeatures​(Map<String,​Object> features)
        Sets the optional features. These features are defined in the statement execution scope. In the case of conflict with the optional features defined in sthe statement/global scope, their priority is higher.
        Parameters:
        features - the optional features
      • setFeature

        public SqlStandardControl setFeature​(String name,
                                             Object value)
        Sets the optional feature in the stament's execution scope.
        Parameters:
        name - the name of the optional feature
        value - the value of the optional feature
      • unsetFeatures

        public SqlStandardControl unsetFeatures​(Set<String> names)
        Clears the optional features in the stament's or execution scope.
        Parameters:
        names - the names of the optional features
      • getFetchSize

        public Integer getFetchSize()
        Returns the fetch size of SQL execution output rows, which can be returned in one SQL statement.
        Specified by:
        getFetchSize in interface SqlControl
        Returns:
        the fetch size of SQL execution output rows
      • setFetchSize

        public SqlStandardControl setFetchSize​(Integer fetchSize)
        Sets the fetch size of SQL execution output rows, which can be returned in one SQL statement.
        Parameters:
        fetchSize - the fetch size of SQL execution output rows
        Returns:
        this instance
      • getSkipEmptyStatement

        public Boolean getSkipEmptyStatement()
        Returns the indicator, that an empty INSERT or UPDATE statement execution should be ignored (for example update statement without any bounded input values).
        Specified by:
        getSkipEmptyStatement in interface SqlControl
        Returns:
        the indicator, that an empty INSERT or UPDATE statement execution should be ignored
      • setSkipEmptyStatement

        public void setSkipEmptyStatement​(Boolean skipEmptyStatement)
        Sets the indicator, that an empty INSERT or UPDATE statement execution should be ignored (for example update statement without any bounded input values).
        Parameters:
        skipEmptyStatement - the indicator, that an empty INSERT or UPDATE statement execution should be ignored
      • setLowLevelSqlCallback

        public SqlStandardControl setLowLevelSqlCallback​(SqlControl.LowLevelSqlCallback lowLevelSqlCallback)
        Sets the low level SQL callback handler.
        Parameters:
        lowLevelSqlCallback - the low level SQL callback handler
        Returns:
        this instance
      • setSqlExecutionCallback

        public SqlStandardControl setSqlExecutionCallback​(SqlControl.SqlExecutionCallback sqlExecutionCallback)
        Sets the SQL command execution callback handler.
        Parameters:
        lowLevelSqlCallback - the SQL command execution callback handler
        Returns:
        this instance
      • getSqlName

        public String getSqlName()
        Returns the name of the required SQL Query Engine instance
        Specified by:
        getSqlName in interface SqlControl
        Returns:
        the name of the required SQL Query Engine instance
      • setSqlName

        public SqlStandardControl setSqlName​(String sqlName)
        Sets the name of the required SQL Query Engine instance
        Parameters:
        sqlName - the name of the required SQL Query Engine instance
        Returns:
        this instance