Interface Data.CrudRepository<E,ID>
- Type Parameters:
E- the entity typeID- the identifier type
- All Superinterfaces:
Data.BasicRepository<E,ID>, Data.GenericRepository<E, ID>
- Enclosing class:
Data
Data repository interface for CRUD entity operations.
CRUD entity operations are:
- Create
- Read
- Update
- Delete
-
Method Summary
Methods inherited from interface Data.BasicRepository
count, delete, deleteAll, deleteAll, deleteById, existsById, findAll, findById, save, saveAllModifier and TypeMethodDescriptionlongcount()Return the number of all entities of theEtype.voidDelete provided entity.longDelete all entities of theEtype.voidDelete all provided entities.longdeleteById(ID id) Delete the entity with the given ID (primary key).booleanexistsById(ID id) Check whether entity with given ID (primary key) exists.findAll()Return all entities of theEtype.Find entity by ID (primary key) value.<T extends E>
Tsave(T entity) Save provided entity.Save all provided entities.
-
Method Details
-
insert
Insert provided entity. This method will insert a new record into the database. The operation will fail if the record is already present in the database.- Type Parameters:
T- type of the entity- Parameters:
entity- the entity to persist, shall not benull- Returns:
- persisted entity, never returns
null - Throws:
DataException- if the entity isnullor the operation has failed
-
insertAll
Insert all provided entities. This method will insert a new record into the database. The operation will fail if the record is already present in the database or entities are not unique.- Type Parameters:
T- type of the entity- Parameters:
entities- the entities to persist, shall not benull- Returns:
- persisted entity, never returns
null - Throws:
DataException- if the entity isnullor the operation has failed
-
update
Update provided entity. This operation will fail if the record is not already present in the database.- Type Parameters:
T- type of the entity- Parameters:
entity- the entity to persist, shall not benull- Returns:
- updated entity, never returns
null - Throws:
DataException- if the entity isnullor the operation has failed
-
updateAll
Update all provided entities. This operation will fail if the record is not already present in the database.- Type Parameters:
T- type of the entity- Parameters:
entities- the entities to persist, shall not benull- Returns:
- updated entities, never returns
null - Throws:
DataException- if the entities arenullor the operation has failed
-