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:
- node_id (BIGINT)
- user_id (BIGINT)
- country (CHAR)
- time_zone (VARCHAR)
- private (BOOLEAN)
- archived (BOOLEAN)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSql()static SelectSolarNodeOwnershipselectForNode(Long nodeId) Select for a single node ID.static SelectSolarNodeOwnershipselectForNodeUser(Long nodeId, Long userId) Select for a single node and user ID.static SelectSolarNodeOwnershipselectForUser(Long userId) Select for a single user ID.
-
Constructor Details
-
SelectSolarNodeOwnership
Constructor.- Parameters:
nodeIds- the optional node IDs to filter onuserIds- the optional user IDs to filter on
-
-
Method Details
-
selectForNode
Select for a single node ID.- Parameters:
nodeId- the node ID- Returns:
- the select statement
- Throws:
IllegalArgumentException- ifnodeIdis null
-
selectForUser
Select for a single user ID.- Parameters:
userId- the user ID- Returns:
- the select statement
- Throws:
IllegalArgumentException- ifuserIdis null
-
selectForNodeUser
Select for a single node and user ID.- Parameters:
nodeId- the node IDuserId- the user ID- Returns:
- the select statement
- Throws:
IllegalArgumentException- ifnodeIdoruserIdis null
-
getSql
- Specified by:
getSqlin interfaceorg.springframework.jdbc.core.SqlProvider
-
createPreparedStatement
- Specified by:
createPreparedStatementin interfaceorg.springframework.jdbc.core.PreparedStatementCreator- Throws:
SQLException
-