Interface GenericCompositeKey2Dao<T extends net.solarnetwork.dao.Entity<K>,K extends CompositeKey2<K1,K2>,K1,K2>
- Type Parameters:
T- the entity type managed by this DAOK- the entity composite primary key typeK1- the primary key's first componentK2- the primary key's second component
- All Superinterfaces:
GenericCompositeKeyFilterableDao<T,,K> net.solarnetwork.dao.GenericDao<T,K>
public interface GenericCompositeKey2Dao<T extends net.solarnetwork.dao.Entity<K>,K extends CompositeKey2<K1,K2>,K1,K2>
extends net.solarnetwork.dao.GenericDao<T,K>, GenericCompositeKeyFilterableDao<T,K>
DAO API using a composite key of 2 components.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.solarnetwork.dao.GenericDao
net.solarnetwork.dao.GenericDao.EntityEventType, net.solarnetwork.dao.GenericDao.StandardSortKey -
Field Summary
Fields inherited from interface net.solarnetwork.dao.GenericDao
ENTITY_EVENT_ENTITY_ID_PROPERTY, ENTITY_EVENT_ENTITY_PROPERTY, ENTITY_EVENT_TOPIC_TEMPLATE, SORT_BY_CREATED_ASCENDING, SORT_BY_CREATED_DESCENDING, SORT_BY_CREATED_ID_ASCENDING, SORT_BY_CREATED_ID_DESCENDING, SORT_BY_ID_ASCENDING, SORT_BY_ID_DESCENDING -
Method Summary
Modifier and TypeMethodDescriptionCreate an entity using a specific first key component, assuming the second component is generated by the database.Find all persisted entities available matching the first key component, optionally sorted in some way.default Collection<T> findAllForKey(K filter, List<net.solarnetwork.domain.SortDescriptor> sorts) Find all persisted entities available matching the components of a composite key, optionally sorted in some way.Methods inherited from interface net.solarnetwork.dao.GenericDao
delete, entityEventTopic, entityKey, get, getAll, getObjectType, save
-
Method Details
-
create
Create an entity using a specific first key component, assuming the second component is generated by the database.- Parameters:
entity- the domain object so store; theIdentity.getId()of the entity will be ignoredkeyComponent- the assigned key component- Returns:
- the primary key of the stored object
-
findAll
Find all persisted entities available matching the first key component, optionally sorted in some way.The
sortDescriptorsparameter can be null, in which case the sort order is not defined and implementation specific.- Parameters:
keyComponent1- the first key component to restrict the results tosorts- list of sort descriptors to sort the results by- Returns:
- list of all persisted entities, or empty list if none available
-
findAllForKey
Description copied from interface:GenericCompositeKeyFilterableDaoFind all persisted entities available matching the components of a composite key, optionally sorted in some way.Only key components that are assigned are used to filter the result. The
sortDescriptorsparameter can be null, in which case the sort order is not defined and implementation specific.- Specified by:
findAllForKeyin interfaceGenericCompositeKeyFilterableDao<T extends net.solarnetwork.dao.Entity<K>,K extends CompositeKey2<K1, K2>> - Parameters:
filter- the key that acts like a filter to restrict the results tosorts- list of sort descriptors to sort the results by- Returns:
- list of all persisted entities, or empty list if none available
-