interface EntityCollection<T, K extends Serializable>
Interface for managing a collection of entities. A collection represents a table.
Type Params | Return Type | Name and description |
---|---|---|
|
abstract CollectionQuery<T> |
createQuery(java.lang.String jpql, java.util.Map<java.lang.String, java.lang.Object> namedParams) Create a CollectionQuery using JPQL and named parameters |
|
abstract CollectionQuery<T> |
createQuery(java.lang.String jpql, java.lang.Object[] positionalParams) Create a CollectionQuery using JPQL and positional parameters |
|
abstract CollectionQuery<T> |
createQuery(java.lang.String jpql)
|
|
abstract void |
delete(K id) Delete an entity |
|
abstract T |
find(K id) Find an entity by its ID. |
|
abstract void |
insert(T instance) Insert an entity. |
|
abstract void |
update(T instance) Update a JPA entity |
|
abstract void |
update(K id, DTO dto) Update a JPA entity using a data transfer object |
Create a CollectionQuery using JPQL and named parameters
jpql
- A JPQL querynamedParams
- Parameters for the queryCreate a CollectionQuery using JPQL and positional parameters
jpql
- A JPQL querypositionalParams
- Parameters for the query
jpql
- A JPQL queryDelete an entity
id
- The ID of the entityFind an entity by its ID.
id
- The ID of the entityInsert an entity. The ID will be written to the supplied object if it is marked with
@GeneratedValue
obj
- An annotated JPA EntityUpdate a JPA entity
instance
- An instance of TUpdate a JPA entity using a data transfer object
id
- The ID of the entity to updatedto
- The data transfer object