public interface EntityPersistence
Responsible for persisting entities to the database.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voiddelete(Entity entity, EntityConnection connection) Deletes the given entity from the database using the given connection.default voiddelete(Collection<Entity> entities, EntityConnection connection) Deletes the given entities from the database using the given connectiondefault Entityinsert(Entity entity, EntityConnection connection) Inserts the given entity into the database using the given connection.default Collection<Entity> insert(Collection<Entity> entities, EntityConnection connection) Inserts the given entities into the database using the given connectiondefault Entityupdate(Entity entity, EntityConnection connection) Updates the given entity in the database using the given connection.default Collection<Entity> update(Collection<Entity> entities, EntityConnection connection) Updates the given entities in the database using the given connection
-
Method Details
-
insert
Inserts the given entity into the database using the given connection.
- Parameters:
entity- the entity to insertconnection- the connection to use- Returns:
- the inserted entity
- Throws:
DatabaseException- in case of a database exception
-
insert
Inserts the given entities into the database using the given connection- Parameters:
entities- the entities to insertconnection- the connection to use- Returns:
- the inserted entities
- Throws:
DatabaseException- in case of a database exception
-
update
Updates the given entity in the database using the given connection.
- Parameters:
entity- the entity to updateconnection- the connection to use- Returns:
- the updated entity
- Throws:
DatabaseException- in case of a database exception
-
update
Updates the given entities in the database using the given connection- Parameters:
entities- the entities to updateconnection- the connection to use- Returns:
- the updated entities
- Throws:
DatabaseException- in case of a database exception
-
delete
Deletes the given entity from the database using the given connection.
- Parameters:
entity- the entity to deleteconnection- the connection to use- Throws:
DatabaseException- in case of a database exception
-
delete
Deletes the given entities from the database using the given connection- Parameters:
entities- the entities to deleteconnection- the connection to use- Throws:
DatabaseException- in case of a database exception
-