Skip to content

Commit

Permalink
add existsById fuction
Browse files Browse the repository at this point in the history
  • Loading branch information
Madmat8 committed Nov 10, 2023
1 parent 25a9d1d commit 3b0d81d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/main/java/hu/blackbelt/judo/dao/api/DAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EReference;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.*;

public interface DAO<ID> {

Expand Down Expand Up @@ -156,6 +153,17 @@ public interface DAO<ID> {
*/
Optional<Payload> searchByIdentifier(EClass clazz, ID identifier, QueryCustomizer<ID> queryCustomizer);

/**
* Checks whether an instance of a given mapped transfer object type with the given identifier exists.
* <p>
* This operation can be used by JCL (expression) and custom Java sources.
*
* @param clazz mapped transfer object type
* @param identifier mapped transfer object
* @return returns whether the given instance exists
*/
boolean existsById(EClass clazz, ID identifier);

/**
* Get (entity) metadata of a given mapped transfer object type by identifier.
* <p>
Expand Down

0 comments on commit 3b0d81d

Please sign in to comment.