Package org.apache.olingo.ext.proxy.api
Interface AbstractEntitySet<T extends EntityType<?>,KEY extends Serializable,EC extends Collection<T>>
- All Superinterfaces:
Iterable<T>,Serializable
- All Known Implementing Classes:
EntitySetInvocationHandler,InlineEntitySetInvocationHandler
public interface AbstractEntitySet<T extends EntityType<?>,KEY extends Serializable,EC extends Collection<T>>
extends Iterable<T>, Serializable
Interface for synchronous CRUD operations on an EntitySet.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancount()Returns the number of entities available.Create an instance of Search.<S extends T,SEC extends EntityCollection<S, ?, ?>>
Search<S,SEC> createSearch(Class<SEC> reference) Create an instance of Search.<S extends T>
voidDeletes the given entities in a batch.voidDeletes the entity with the given key.<S extends T>
voiddelete(S entity) Deletes the given entity in a batch.Returns whether an entity with the given id exists.Retrieves an entity by its key.<S extends T>
SRetrieves an entity by its key, considering polymorphism.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
add
-
exists
Returns whether an entity with the given id exists.- Parameters:
key- must not be null- Returns:
- true if an entity with the given id exists, false otherwise
- Throws:
IllegalArgumentException- in case the given key is null
-
getByKey
Retrieves an entity by its key.- Parameters:
key- must not be null- Returns:
- the entity with the given id or null if none found
- Throws:
IllegalArgumentException- in case the given key is null
-
getByKey
Retrieves an entity by its key, considering polymorphism.- Type Parameters:
S-- Parameters:
key- must not be nullreference- entity class to be returned- Returns:
- the entity with the given id or null if none found
- Throws:
IllegalArgumentException- in case the given key is null
-
count
Long count()Returns the number of entities available.- Returns:
- the number of entities
-
delete
Deletes the entity with the given key.- Parameters:
key- must not be null- Throws:
IllegalArgumentException- in case the given key is null
-
delete
Deletes the given entity in a batch.- Type Parameters:
S-- Parameters:
entity- to be deleted
-
delete
Deletes the given entities in a batch.- Type Parameters:
S-- Parameters:
entities- to be deleted
-
createSearch
Create an instance of Search.- Returns:
- the new search instance
-
createSearch
<S extends T,SEC extends EntityCollection<S, Search<S,?, ?>> SEC> createSearch(Class<SEC> reference) Create an instance of Search.- Type Parameters:
S-SEC-- Parameters:
reference-- Returns:
- the new search instance
-