Package net.solarnetwork.central.dao
Interface GenericDao<T extends net.solarnetwork.dao.Entity<PK>,PK extends Serializable>
- Type Parameters:
T- the domain object typePK- the primary key type
- All Known Subinterfaces:
SolarLocationDao,SolarNodeDao,SolarNodeMetadataDao
- All Known Implementing Classes:
BaseMyBatisFilterableDao,BaseMyBatisGenericDao,MyBatisSolarLocationDao,MyBatisSolarNodeDao,MyBatisSolarNodeMetadataDao
public interface GenericDao<T extends net.solarnetwork.dao.Entity<PK>,PK extends Serializable>
Generic DAO API.
Based in part on http://www-128.ibm.com/developerworks/java/library/j-genericdao.html.
-
Method Summary
Modifier and TypeMethodDescriptionvoidRemove an object from persistent storage in the database.Get a persisted domain object by its primary key.Get a list of persisted domain objects, optionally sorted in some way.Get the class supported by this Dao.Persist the domainObject object into database, creating or updating as appropriate.
-
Method Details
-
getObjectType
Get the class supported by this Dao.- Returns:
- class
-
store
Persist the domainObject object into database, creating or updating as appropriate.- Parameters:
domainObject- the domain object so store- Returns:
- the primary key of the stored object
-
get
Get a persisted domain object by its primary key.- Parameters:
id- the primary key to retrieve- Returns:
- the domain object
-
getAll
Get a list of persisted domain objects, optionally sorted in some way.The
sortDescriptorsparameter can be null, in which case the sort order is not defined and implementation specific.- Parameters:
sortDescriptors- list of sort descriptors to sort the results by- Returns:
- list of all persisted domain objects, or empty list if none available
- Since:
- 1.2
-
delete
Remove an object from persistent storage in the database.- Parameters:
domainObject- the domain object to delete
-