Package jakarta.data.repository
package jakarta.data.repository
A repository is an interface annotated with Repository
that defines
operations on entities. Entities represent data in the persistent store.
In Domain-driven design, a repository participates in the domain but abstracts away storage
and infrastructure details.
Repository interfaces can optionally inherit from built-in interfaces within this package,
DataRepository
- root of the hierarchy, allows the entity type to be specified as a type parameter.BasicRepository
- provides common find, delete, and save operations.CrudRepository
- extends theBasicRepository
to addCrudRepository.insert(java.lang.Object)
andCrudRepository.update(java.lang.Object)
operations.
Repository interfaces can also define their own lifecycle methods using the
Insert
, Update
, Save
, and Delete
annotations,
as well as a variety of other methods following the Query by Method Name pattern,
the Parameter-based Conditions pattern, and the Query
annotation.
The module Javadoc provides an overview
of Jakarta Data.
-
ClassDescriptionBasicRepository<T,
K> A built-in repository supertype for performing basic operations on entities.Annotates a parameter of a repository method, specifying a mapping to a persistent field:CrudRepository<T,K> A built-in repository supertype for performing Create, Read, Update, and Delete (CRUD) operations.DataRepository<T,K> A built-in repository supertype that is the root of all other built-in repository supertype interfaces.Lifecycle annotation for repository methods which perform delete operations; alternatively, annotates a repository method as a parameter-based automatic query method which deletes entities.Annotates a repository method returning entities as a parameter-based automatic query method.Lifecycle annotation for repository methods which perform insert operations.Annotates a repository method to request sorting of results.Enables multipleOrderBy
annotations on the method.Annotates a parameter of a repository method to bind it to a named parameter of aQuery
.Annotates a repository method as a query method, specifying a query written in Jakarta Data Query Language (JDQL) or in Jakarta Persistence Query Language (JPQL).Annotates a repository interface to be implemented by the container/runtime.Lifecycle annotation for repository methods which conditionally perform insert or update operations.Lifecycle annotation for repository methods which perform update operations.