E - the type to perform CRUD operations onpublic interface CrudRepository<E>
Repository providing basic CRUD operations for POJOs.
Entity fields should be annotated using the Java Persistence API with:
@Column(name = "YOUR_COLUMN_NAME").
The class should be annotated using the Java Persistence API with:
@Table(name = "YOUR_TABLE_NAME)
unless the class has the same name as the database table.
| Modifier and Type | Method and Description |
|---|---|
boolean |
create(E entity)
Insert an entity into the database.
|
void |
createMany(java.util.List<E> entities)
Insert a list of entities into the database.
|
boolean |
delete(E entity)
Delete an entity from the database.
|
java.util.List<E> |
readAll()
Get all entities of type
<E> from the database. |
java.util.List<E> |
readAllWhere(org.jooq.Condition condition)
Get all entities of type
<E> from the database where a certain condition is met. |
E |
readOneWhere(org.jooq.Condition condition)
Get a single entity of type
<E> from the database where a certain condition is met. |
boolean |
updateWhere(E entity,
org.jooq.Condition condition)
Replace entities in the database with the provided entity where a specific condition is met.
|
boolean create(E entity)
entity - the entity to persisttrue if successful, false otherwisevoid createMany(java.util.List<E> entities)
entities - the entities to persistjava.util.List<E> readAll()
<E> from the database.java.util.List<E> readAllWhere(org.jooq.Condition condition)
<E> from the database where a certain condition is met.condition - the condition to meetE readOneWhere(org.jooq.Condition condition)
<E> from the database where a certain condition is met.condition - the condition to meetnull if there are no resultsboolean updateWhere(E entity, org.jooq.Condition condition)
entity - the entity to replace the entities withcondition - the condition to meettrue if the update was successful, false otherwiseboolean delete(E entity)
entity - the entity to delete from the databasetrue if the entity was deleted, false otherwiseCopyright © 2021. All rights reserved.