T
- the domain type the repository managesID
- the type of the id of the entity the repository manages@NoRepositoryBean
public interface JmixDataRepository<T,ID>
extends org.springframework.data.repository.PagingAndSortingRepository<T,ID>
Extends functionality of PagingAndSortingRepository
by adding FetchPlan parameters to common methods and providing
other Jmix-specific methods
PagingAndSortingRepository
Modifier and Type | Method and Description |
---|---|
T |
create()
Instantiate an entity.
|
java.lang.Iterable<T> |
findAll(FetchPlan fetchPlan)
Returns all instances of the type
T loaded according to fetchPlan |
java.lang.Iterable<T> |
findAll(java.lang.Iterable<ID> ids,
FetchPlan fetchPlan)
Returns all instances of the type
T with the given IDs loaded according to fetchPlan |
org.springframework.data.domain.Page<T> |
findAll(org.springframework.data.domain.Pageable pageable,
FetchPlan fetchPlan)
Returns a
Page of entities meeting the paging restriction provided in the Pageable object. |
java.lang.Iterable<T> |
findAll(org.springframework.data.domain.Sort sort,
FetchPlan fetchPlan)
Returns all entities sorted by the given options and loaded by specified FetchPlan.
|
java.util.Optional<T> |
findById(ID id,
FetchPlan fetchPlan)
Loads an entity by its
id according to fetchPlan |
T |
getById(ID id,
FetchPlan fetchPlan)
Loads an entity by its
id according to fetchPlan |
T create()
Metadata.create(Class)
<T>
.java.util.Optional<T> findById(ID id, FetchPlan fetchPlan)
id
according to fetchPlan
id
- must not be null.T getById(ID id, FetchPlan fetchPlan)
id
according to fetchPlan
id
- must not be null.java.lang.IllegalStateException
- if nothing was loadedjava.lang.Iterable<T> findAll(FetchPlan fetchPlan)
T
loaded according to fetchPlan
java.lang.Iterable<T> findAll(java.lang.Iterable<ID> ids, @Nullable FetchPlan fetchPlan)
T
with the given IDs loaded according to fetchPlan
If some or all ids are not found, no entities are returned for these IDs.
fetchPlan
- defines entity graph to load. FetchPlan#BASE
will be used instead in case of null.ids
- must not be null nor contain any null values.java.lang.IllegalArgumentException
- in case the given ids
or one of its items is null.java.lang.Iterable<T> findAll(org.springframework.data.domain.Sort sort, @Nullable FetchPlan fetchPlan)
fetchPlan
- to load entity. FetchPlan#BASE
will be used if fetchPlan == null
org.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageable, @Nullable FetchPlan fetchPlan)
Page
of entities meeting the paging restriction provided in the Pageable
object.
Entities will be loaded according to passed fetchPlan
fetchPlan
- to load entities. FetchPlan#BASE
will be used if fetchPlan == null