Skip to content

Commit

Permalink
JNG-4235 Batch create update delete support (#63)
Browse files Browse the repository at this point in the history
* JNG-4235 Initial feature commit [ci skip]

* add batch crud support

* add javadoc for batch CRUD operations

* update javadoc

* update javadoc

* fix javadoc
  • Loading branch information
Madmat8 authored Jan 15, 2024
1 parent 0bd3620 commit d19eb19
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions src/main/java/hu/blackbelt/judo/dao/api/DAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,20 @@ public interface DAO<ID> {
*/
Payload create(EClass clazz, Payload payload, QueryCustomizer<ID> queryCustomizer);


/**
* Create new instances of a given mapped transfer object type.
* <p>
* This operation can be used by JCL (create), exposed graphs (ExposedGraph#create) and custom Java sources. Mapped
* transfer object must have a filter to restrict which kind of instances can be created by exposed services.
*
* @param clazz mapped transfer object type
* @param payloads instances to create
* @param queryCustomizer query customizer (i.e. filtering, ordering, seeking)
* @return created instance
*/
List<Payload> createAll(EClass clazz, Iterable<Payload> payloads, QueryCustomizer<ID> queryCustomizer);

/**
* Update a mapped transfer object.
* <p>
Expand All @@ -223,15 +237,37 @@ public interface DAO<ID> {
*/
Payload update(EClass clazz, Payload payload, QueryCustomizer<ID> queryCustomizer);

/**
* Update mapped transfer objects.
* <p>
* This operation can be used by JCL (update) and custom Java sources.
*
* @param clazz mapped transfer object type
* @param payloads instances to update
* @param queryCustomizer query customizer (i.e. filtering, ordering, seeking)
* @return updated instance
*/
List<Payload> updateAll(EClass clazz, Iterable<Payload> payloads, QueryCustomizer<ID> queryCustomizer);

/**
* Delete a mapped transfer object.
* <p>
* This operation can be used by JCL (delete) and custom Java sources.
*
* @param clazz mapped transfer object type
* @param id instance ID to delete
* @param ids instance ID to delete
*/
void delete(EClass clazz, ID ids);

/**
* Delete mapped transfer objects.
* <p>
* This operation can be used by JCL (delete) and custom Java sources.
*
* @param clazz mapped transfer object type
* @param id instance IDs to delete
*/
void delete(EClass clazz, ID id);
void deleteAll(EClass clazz, Iterable<ID> id);

/**
* Set references of a given mapped transfer object.
Expand Down

0 comments on commit d19eb19

Please sign in to comment.