Skip to content

Commit

Permalink
Fix two CrudRepository method names that do no follow the spec rules,…
Browse files Browse the repository at this point in the history
… and resolve merge conflict

Signed-off-by: Nathan Rauh <[email protected]>
  • Loading branch information
njr-11 committed Sep 26, 2023
1 parent 4ce83d7 commit 6f68807
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public interface BasicRepository<T, K> extends DataRepository<T, K> {
* {@literal ids}.
* @throws NullPointerException in case the given {@link Iterable ids} or one of its items is {@literal null}.
*/
Stream<T> findAllById(Iterable<K> ids);
Stream<T> findByIdIn(Iterable<K> ids);

/**
* Retrieves the total number of persistent entities of the specified type in the database.
Expand Down Expand Up @@ -162,7 +162,7 @@ public interface BasicRepository<T, K> extends DataRepository<T, K> {
* @param ids must not be {@literal null}. Must not contain {@literal null} elements.
* @throws NullPointerException when either the iterable is null or contains null elements
*/
void deleteAllById(Iterable<K> ids);
void deleteByIdIn(Iterable<K> ids);

/**
* Deletes the given entities. Deletion of each entity is performed by matching the ID, and if the entity is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public interface ReadOnlyRepository<T, K> extends DataRepository<T, K>{

Stream<T> findAll();

Stream<T> findAllById(Iterable<K> ids);
Stream<T> findByIdIn(Iterable<K> ids);

long count();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void testCrudRepository() {
assertEquals(true, numbers.existsById(80L));

Stream<NaturalNumber> found;
found = numbers.findAllById(List.of(70L, 40L, -20L, 10L));
found = numbers.findByIdIn(List.of(70L, 40L, -20L, 10L));
assertEquals(List.of(10L, 40L, 70L),
found.map(NaturalNumber::getId).sorted().collect(Collectors.toList()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ meth public abstract <%0 extends {jakarta.data.repository.BasicRepository%0}> {%
meth public abstract boolean existsById({jakarta.data.repository.BasicRepository%1})
meth public abstract java.util.Optional<{jakarta.data.repository.BasicRepository%0}> findById({jakarta.data.repository.BasicRepository%1})
meth public abstract java.util.stream.Stream<{jakarta.data.repository.BasicRepository%0}> findAll()
meth public abstract java.util.stream.Stream<{jakarta.data.repository.BasicRepository%0}> findAllById(java.lang.Iterable<{jakarta.data.repository.BasicRepository%1}>)
meth public abstract java.util.stream.Stream<{jakarta.data.repository.BasicRepository%0}> findByIdIn(java.lang.Iterable<{jakarta.data.repository.BasicRepository%1}>)
meth public abstract long count()
meth public abstract void delete({jakarta.data.repository.BasicRepository%0})
meth public abstract void deleteAll()
meth public abstract void deleteAll(java.lang.Iterable<? extends {jakarta.data.repository.BasicRepository%0}>)
meth public abstract void deleteAllById(java.lang.Iterable<{jakarta.data.repository.BasicRepository%1}>)
meth public abstract void deleteById({jakarta.data.repository.BasicRepository%1})
meth public abstract void deleteByIdIn(java.lang.Iterable<{jakarta.data.repository.BasicRepository%1}>)

CLSS public abstract interface jakarta.data.repository.DataRepository<%0 extends java.lang.Object, %1 extends java.lang.Object>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ meth public abstract <%0 extends {jakarta.data.repository.BasicRepository%0}> {%
meth public abstract boolean existsById({jakarta.data.repository.BasicRepository%1})
meth public abstract java.util.Optional<{jakarta.data.repository.BasicRepository%0}> findById({jakarta.data.repository.BasicRepository%1})
meth public abstract java.util.stream.Stream<{jakarta.data.repository.BasicRepository%0}> findAll()
meth public abstract java.util.stream.Stream<{jakarta.data.repository.BasicRepository%0}> findAllById(java.lang.Iterable<{jakarta.data.repository.BasicRepository%1}>)
meth public abstract java.util.stream.Stream<{jakarta.data.repository.BasicRepository%0}> findByIdIn(java.lang.Iterable<{jakarta.data.repository.BasicRepository%1}>)
meth public abstract long count()
meth public abstract void delete({jakarta.data.repository.BasicRepository%0})
meth public abstract void deleteAll()
meth public abstract void deleteAll(java.lang.Iterable<? extends {jakarta.data.repository.BasicRepository%0}>)
meth public abstract void deleteAllById(java.lang.Iterable<{jakarta.data.repository.BasicRepository%1}>)
meth public abstract void deleteById({jakarta.data.repository.BasicRepository%1})
meth public abstract void deleteByIdIn(java.lang.Iterable<{jakarta.data.repository.BasicRepository%1}>)

CLSS public abstract interface jakarta.data.repository.DataRepository<%0 extends java.lang.Object, %1 extends java.lang.Object>

Expand Down

0 comments on commit 6f68807

Please sign in to comment.