Class SelectSolarNodeOwnership

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

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

The result columns in the SQL are:

  1. node_id (BIGINT)
  2. user_id (BIGINT)
  3. country (CHAR)
  4. time_zone (VARCHAR)
  5. private (BOOLEAN)
  6. archived (BOOLEAN)
  • Constructor Details

    • SelectSolarNodeOwnership

      public SelectSolarNodeOwnership(Long[] nodeIds, Long[] userIds)
      Constructor.
      Parameters:
      nodeIds - the optional node IDs to filter on
      userIds - the optional user IDs to filter on
  • Method Details

    • selectForNode

      public static SelectSolarNodeOwnership selectForNode(Long nodeId)
      Select for a single node ID.
      Parameters:
      nodeId - the node ID
      Returns:
      the select statement
      Throws:
      IllegalArgumentException - if nodeId is null
    • selectForUser

      public static SelectSolarNodeOwnership selectForUser(Long userId)
      Select for a single user ID.
      Parameters:
      userId - the user ID
      Returns:
      the select statement
      Throws:
      IllegalArgumentException - if userId is null
    • selectForNodeUser

      public static SelectSolarNodeOwnership selectForNodeUser(Long nodeId, Long userId)
      Select for a single node and user ID.
      Parameters:
      nodeId - the node ID
      userId - the user ID
      Returns:
      the select statement
      Throws:
      IllegalArgumentException - if nodeId or userId 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