Class MyBatisSolarLocationDao
java.lang.Object
org.springframework.dao.support.DaoSupport
org.mybatis.spring.support.SqlSessionDaoSupport
net.solarnetwork.central.dao.mybatis.support.BaseMyBatisDao
net.solarnetwork.central.dao.mybatis.support.BaseMyBatisGenericDao<SolarLocation,Long>
net.solarnetwork.central.dao.mybatis.support.BaseMyBatisFilterableDao<SolarLocation,LocationMatch,Location,Long>
net.solarnetwork.central.dao.mybatis.MyBatisSolarLocationDao
- All Implemented Interfaces:
FilterableDao<LocationMatch,,Long, Location> GenericDao<SolarLocation,,Long> SolarLocationDao,org.springframework.beans.factory.InitializingBean
public class MyBatisSolarLocationDao
extends BaseMyBatisFilterableDao<SolarLocation,LocationMatch,Location,Long>
implements SolarLocationDao
MyBatis implementation of
SolarLocationDao.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe query name used forgetSolarLocationForTimeZone(String, String).static final StringThe query name used forgetSolarLocationForLocation(Location).static final StringThe query name used forgetSolarLocationForNode(Long).Fields inherited from class net.solarnetwork.central.dao.mybatis.support.BaseMyBatisFilterableDao
FILTER_PROPERTYFields inherited from class net.solarnetwork.central.dao.mybatis.support.BaseMyBatisGenericDao
BEAN_OBJECT_PROPERTY, CHILD_DELETE, CHILD_INSERT, CHILD_UPDATE, DATE_PROPERTY, DELETE_OBJECT, ERROR_CODE_INVALID_QUERY, ID_PROPERTY, INDEX_PROPERTY, INSERT_OBJECT, QUERY_FOR_ALL, QUERY_FOR_ID, RELATION_DELETE, RELATION_INSERT, RELATION_LIST_QUERY_FOR_PARENT, RELATION_OBJ_QUERY_FOR_PARENT, RELATION_UPDATE, SORT_DESCRIPTORS_PROPERTY, UPDATE_OBJECTFields inherited from class net.solarnetwork.central.dao.mybatis.support.BaseMyBatisDao
FIRST_ROW, logFields inherited from class org.springframework.dao.support.DaoSupport
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSolarLocationForLocation(Location criteria) Find a SolarLocation that exactly matches the given criteria.getSolarLocationForNode(Long nodeId) Get the location associated with a node.getSolarLocationForTimeZone(String country, String timeZoneId) Find a SolarLocation for just a country and time zone.protected voidpostProcessFilterProperties(Location filter, Map<String, Object> sqlProps) Callback to alter the default SQL properties set up byBaseMyBatisFilterableDao.findFiltered(Filter, List, Integer, Integer).store(SolarLocation datum) Persist the domainObject object into database, creating or updating as appropriate.Methods inherited from class net.solarnetwork.central.dao.mybatis.support.BaseMyBatisFilterableDao
executeFilterCountQuery, findFiltered, getFilteredQueryMethods inherited from class net.solarnetwork.central.dao.mybatis.support.BaseMyBatisGenericDao
delete, execute, get, getAll, getChildDelete, getChildInsert, getChildUpdate, getDelete, getDomainClass, getInsert, getMemberDomainKey, getMessageSource, getObjectType, getPrimaryKeyType, getQueryForAll, getQueryForId, getRelationDelete, getRelationInsert, getRelationObjectQueryForParent, getRelationQueryForParent, getRelationUpdate, getUpdate, handleAssignedPrimaryKeyStore, handleChildRelation, handleInsert, handleRelation, handleRelation, handleUpdate, mapSqlMapException, preprocessInsert, setChildDelete, setChildInsert, setChildUpdate, setDelete, setInsert, setMessageSource, setQueryForAll, setQueryForId, setRelationDelete, setRelationInsert, setRelationObjectQueryForParent, setRelationQueryForParent, setRelationUpdate, setUpdate, spaceAppendMethods inherited from class net.solarnetwork.central.dao.mybatis.support.BaseMyBatisDao
executeCountQuery, selectFiltered, selectFiltered, selectFiltered, selectFiltered, selectFirst, selectList, selectLong, setSqlSessionFactoryMethods inherited from class org.mybatis.spring.support.SqlSessionDaoSupport
checkDaoConfig, createSqlSessionTemplate, getSqlSession, getSqlSessionFactory, getSqlSessionTemplate, setSqlSessionTemplateMethods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDaoMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.solarnetwork.central.dao.FilterableDao
findFilteredMethods inherited from interface net.solarnetwork.central.dao.GenericDao
delete, get, getAll, getObjectType
-
Field Details
-
QUERY_FOR_COUNTRY_TIME_ZONE
The query name used forgetSolarLocationForTimeZone(String, String).- See Also:
-
QUERY_FOR_EXACT_LOCATION
The query name used forgetSolarLocationForLocation(Location).- See Also:
-
QUERY_FOR_NODE
The query name used forgetSolarLocationForNode(Long).- Since:
- 1.1
- See Also:
-
-
Constructor Details
-
MyBatisSolarLocationDao
public MyBatisSolarLocationDao()Default constructor.
-
-
Method Details
-
store
Description copied from interface:GenericDaoPersist the domainObject object into database, creating or updating as appropriate.- Specified by:
storein interfaceGenericDao<SolarLocation,Long> - Overrides:
storein classBaseMyBatisGenericDao<SolarLocation,Long> - Parameters:
datum- the domain object so store- Returns:
- the primary key of the stored object
-
getSolarLocationForTimeZone
Description copied from interface:SolarLocationDaoFind a SolarLocation for just a country and time zone.- Specified by:
getSolarLocationForTimeZonein interfaceSolarLocationDao- Parameters:
country- the countrytimeZoneId- the time zone ID- Returns:
- the SolarLocation, or null if none found
-
getSolarLocationForLocation
Description copied from interface:SolarLocationDaoFind a SolarLocation that exactly matches the given criteria. By exactly matching, even empty fields must match.- Specified by:
getSolarLocationForLocationin interfaceSolarLocationDao- Parameters:
criteria- the search criteria- Returns:
- the matching location, or null if not found
-
postProcessFilterProperties
Description copied from class:BaseMyBatisFilterableDaoCallback to alter the default SQL properties set up byBaseMyBatisFilterableDao.findFiltered(Filter, List, Integer, Integer).- Overrides:
postProcessFilterPropertiesin classBaseMyBatisFilterableDao<SolarLocation,LocationMatch, Location, Long> - Parameters:
filter- the current filtersqlProps- the properties
-
getSolarLocationForNode
Description copied from interface:SolarLocationDaoGet the location associated with a node.- Specified by:
getSolarLocationForNodein interfaceSolarLocationDao- Parameters:
nodeId- the node ID to get the location for- Returns:
- the location, or null if not found
-