Package io.jmix.core.repository
Interface JmixDataRepository<T,ID> 
- Type Parameters:
- T- the domain type the repository manages
- ID- the type of the id of the entity the repository manages
- All Superinterfaces:
- org.springframework.data.repository.CrudRepository<T,,- ID> - org.springframework.data.repository.PagingAndSortingRepository<T,,- ID> - org.springframework.data.repository.Repository<T,- ID> 
- All Known Implementing Classes:
- JmixDataRepositoryImpl
@NoRepositoryBean
public interface JmixDataRepository<T,ID> 
extends org.springframework.data.repository.PagingAndSortingRepository<T,ID>, org.springframework.data.repository.CrudRepository<T,ID>  
Central Jmix data repository interface.
 
 Extends functionality of PagingAndSortingRepository by adding FetchPlan parameters to common methods and providing
 other Jmix-specific methods
- See Also:
- 
- PagingAndSortingRepository
 
- 
Method SummaryModifier and TypeMethodDescriptionlongcount(JmixDataRepositoryContext context) Returns the number of entities satisfyingcontextavailable.create()Instantiate an entity.Returns all instances of the typeTloaded according tofetchPlanfindAll(JmixDataRepositoryContext context) Returns all instances of the typeTloaded bycontextReturns all instances of the typeTwith the given IDs loaded according tofetchPlanorg.springframework.data.domain.Page<T>Returns aPageof entities meeting the paging restriction provided in thePageableobject.org.springframework.data.domain.Page<T>findAll(org.springframework.data.domain.Pageable pageable, JmixDataRepositoryContext jmixContext) Returns aPageof entities meeting the paging restriction provided in thePageableobject.Returns all entities sorted by the given options and loaded by specified FetchPlan.Loads an entity by itsidaccording tofetchPlanLoads an entity by itsidLoads an entity by itsidaccording tofetchPlan<S extends T>
 SSaves theentityand returns saved instance loaded with specifiedfetchPlan.Methods inherited from interface org.springframework.data.repository.CrudRepositorycount, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAllById, findById, save, saveAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepositoryfindAll, findAll
- 
Method Details- 
createT create()Instantiate an entity. InvokesMetadata.create(Class)- Returns:
- new instance of <T>.
 
- 
findByIdLoads an entity by itsidaccording tofetchPlan- Parameters:
- id- must not be null.
- Returns:
- the entity with the given id or Optional#empty() if none found.
 
- 
getByIdLoads an entity by itsidaccording tofetchPlan- Parameters:
- id- must not be null.
- Returns:
- the entity with the given id
- Throws:
- NoResultException- if nothing was loaded
 
- 
getByIdLoads an entity by itsid- Parameters:
- id- must not be null.
- Returns:
- the entity with the given id
- Throws:
- NoResultException- if nothing was loaded
 
- 
findAllReturns all instances of the typeTloaded according tofetchPlan- Returns:
- all entities
 
- 
findAllReturns all instances of the typeTloaded bycontext- Returns:
- entities by context
- See Also:
 
- 
findAllReturns all instances of the typeTwith the given IDs loaded according tofetchPlanIf some or all ids are not found, no entities are returned for these IDs. - Parameters:
- fetchPlan- defines entity graph to load.- FetchPlan.BASEwill be used instead in case of null.
- ids- must not be null nor contain any null values.
- Returns:
- guaranteed to be not null. The size can be equal or less than the number of given ids.
- Throws:
- IllegalArgumentException- in case the given- idsor one of its items is null.
 
- 
findAllReturns all entities sorted by the given options and loaded by specified FetchPlan.- Parameters:
- fetchPlan- to load entity.- FetchPlan.BASEwill be used if- fetchPlan == null
- Returns:
- all entities sorted by the given options
 
- 
findAllorg.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageable, @Nullable FetchPlan fetchPlan) Returns aPageof entities meeting the paging restriction provided in thePageableobject. Entities will be loaded according to passedfetchPlan- Parameters:
- fetchPlan- to load entities.- FetchPlan.BASEwill be used if- fetchPlan == null
- Returns:
- a page of entities
 
- 
findAllorg.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageable, JmixDataRepositoryContext jmixContext) Returns aPageof entities meeting the paging restriction provided in thePageableobject. Entities will be loaded according to passedparams- Parameters:
- jmixContext-- JmixDataRepositoryContextto load entities.
- Returns:
- a page of entities
 
- 
countReturns the number of entities satisfyingcontextavailable.- Returns:
- the number of entities satisfying context.
 
- 
saveSaves theentityand returns saved instance loaded with specifiedfetchPlan.- Parameters:
- entity- entity to save. Must not be null
- fetchPlan-- FetchPlanto reload saved entity with. Must be applicable to- entity
- Throws:
- IllegalArgumentException- if- fetchPlanis not applicable to entity
 
- 
getDataManagerDataManager getDataManager()- Returns:
- DataManagerto use in default methods.
 
 
-