Deletes the given entities in a batch which means it will create a single query.
Deprecated.
Deletes the given entities in a batch which means it will create a single query. This kind of operation leaves JPAs
first level cache and the database out of sync. Consider flushing the
EntityManager
before calling this
method.
Parameters:
entities
- entities to be deleted. Must not be null.
deleteAllInBatch
void
deleteAllInBatch
(
Iterable
<
T
> entities)
Deletes the given entities in a batch which means it will create a single query. This kind of operation leaves JPAs
first level cache and the database out of sync. Consider flushing the
EntityManager
before calling this
method.
Parameters:
entities
- entities to be deleted. Must not be null.
Since:
deleteAllByIdInBatch
Deletes the entities identified by the given ids using a single query. This kind of operation leaves JPAs first
level cache and the database out of sync. Consider flushing the
EntityManager
before calling this method.
Parameters:
ids
- the ids of the entities to be deleted. Must not be null.
Since:
Returns a reference to the entity with the given identifier. Depending on how the JPA persistence provider is
implemented this is very likely to always return an instance and throw an
EntityNotFoundException
on first access. Some of them will reject invalid identifiers
immediately.
Parameters:
id
- must not be null.
Returns:
a reference to the entity with the given identifier.
See Also:
for details on when an exception is thrown.
Returns a reference to the entity with the given identifier. Depending on how the JPA persistence provider is
implemented this is very likely to always return an instance and throw an
EntityNotFoundException
on first access. Some of them will reject invalid identifiers
immediately.
Parameters:
id
- must not be null.
Returns:
a reference to the entity with the given identifier.
Since:
See Also:
for details on when an exception is thrown.
getReferenceById
T
getReferenceById
(
ID
id)
Returns a reference to the entity with the given identifier. Depending on how the JPA persistence provider is
implemented this is very likely to always return an instance and throw an
EntityNotFoundException
on first access. Some of them will reject invalid identifiers
immediately.
Parameters:
id
- must not be null.
Returns:
a reference to the entity with the given identifier.
Since:
See Also:
for details on when an exception is thrown.
deleteAllInBatch(Iterable)
instead.