Class SelectAppSetting

java.lang.Object
net.solarnetwork.central.common.dao.jdbc.sql.SelectAppSetting
All Implemented Interfaces:
org.springframework.jdbc.core.PreparedStatementCreator, org.springframework.jdbc.core.SqlProvider

public class SelectAppSetting extends Object implements org.springframework.jdbc.core.PreparedStatementCreator, org.springframework.jdbc.core.SqlProvider
Select for AppSetting instances.

The result columns in the SQL are:

  1. created (TIMESTAMP)
  2. modified (TIMESTAMP)
  3. skey (VARCHAR)
  4. stype (VARCHAR)
  5. svalue (VARCHAR)
Since:
2.0
  • Constructor Details

    • SelectAppSetting

      public SelectAppSetting(String[] keys, String[] types)
      Constructor.
      Parameters:
      keys - the optional keys to filter on
      types - the optional types to filter on
    • SelectAppSetting

      public SelectAppSetting(String[] keys, String[] types, boolean forUpdate)
      Constructor.
      Parameters:
      keys - the optional keys to filter on
      types - the optional types to filter on
      forUpdate - true to use "for update" locking semantics
  • Method Details

    • selectForKey

      public static SelectAppSetting selectForKey(String key)
      Select for a single key.
      Parameters:
      key - the key
      Returns:
      the select statement
      Throws:
      IllegalArgumentException - if any argument is null
    • selectForKey

      public static SelectAppSetting selectForKey(String key, boolean forUpdate)
      Select for a single key for update.
      Parameters:
      key - the key
      forUpdate - true to use "for update" locking semantics
      Returns:
      the select statement
      Throws:
      IllegalArgumentException - if any argument is null
    • selectForKeyType

      public static SelectAppSetting selectForKeyType(String key, String type)
      Select for a single key and type.
      Parameters:
      key - the key
      type - the type
      Returns:
      the select statement
      Throws:
      IllegalArgumentException - if any argument is null
    • selectForKeyType

      public static SelectAppSetting selectForKeyType(String key, String type, boolean forUpdate)
      Select for a single key and type.
      Parameters:
      key - the key
      type - the type
      forUpdate - true to use "for update" locking semantics
      Returns:
      the select statement
      Throws:
      IllegalArgumentException - if any argument is null
    • getSql

      public String getSql()
      Specified by:
      getSql in interface org.springframework.jdbc.core.SqlProvider
    • createPreparedStatement

      public PreparedStatement createPreparedStatement(Connection con) throws SQLException
      Specified by:
      createPreparedStatement in interface org.springframework.jdbc.core.PreparedStatementCreator
      Throws:
      SQLException