public interface AbstractEntitySet<T extends EntityType<?>,KEY extends Serializable,EC extends Collection<T>> extends Iterable<T>, Serializable
| Modifier and Type | Method and Description | 
|---|---|
| boolean | add(T entity) | 
| Long | count()Returns the number of entities available. | 
| Search<T,EC> | createSearch()Create an instance of Search. | 
| <S extends T,SEC extends EntityCollection<S,?,?>> | createSearch(Class<SEC> reference)Create an instance of Search. | 
| <S extends T> | delete(Iterable<S> entities)Deletes the given entities in a batch. | 
| void | delete(KEY key)Deletes the entity with the given key. | 
| <S extends T> | delete(S entity)Deletes the given entity in a batch. | 
| Boolean | exists(KEY key)Returns whether an entity with the given id exists. | 
| T | getByKey(KEY key)Retrieves an entity by its key. | 
| <S extends T> | getByKey(KEY key,
        Class<S> reference)Retrieves an entity by its key, considering polymorphism. | 
forEach, iterator, spliteratorboolean add(T entity)
Boolean exists(KEY key) throws IllegalArgumentException
key - must not be nullIllegalArgumentException - in case the given key is nullT getByKey(KEY key) throws IllegalArgumentException
key - must not be nullIllegalArgumentException - in case the given key is null<S extends T> S getByKey(KEY key, Class<S> reference) throws IllegalArgumentException
S - key - must not be nullreference - entity class to be returnedIllegalArgumentException - in case the given key is nullLong count()
void delete(KEY key) throws IllegalArgumentException
key - must not be nullIllegalArgumentException - in case the given key is null<S extends T> void delete(S entity)
S - entity - to be deleted<S extends T> void delete(Iterable<S> entities)
S - entities - to be deletedSearch<T,EC> createSearch()
<S extends T,SEC extends EntityCollection<S,?,?>> Search<S,SEC> createSearch(Class<SEC> reference)
S - SEC - reference - Copyright © 2013–2023 The Apache Software Foundation. All rights reserved.