Skip to content

Commit 63d3d32

Browse files
committed
rename findAll -> findMultiple, getAll -> getMultiple
1 parent 86db807 commit 63d3d32

File tree

9 files changed

+23
-23
lines changed

9 files changed

+23
-23
lines changed

hibernate-core/src/main/java/org/hibernate/Session.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,8 @@ public interface Session extends SharedSessionContract, EntityManager {
697697
* matching a given identifier. If an instance is already associated with the session, that
698698
* instance is returned. This method never returns an uninitialized instance.
699699
* <p>
700-
* Every object returned by {@code findAll()} is either an unproxied instance of the given
701-
* entity class, or a fully-fetched proxy object.
700+
* Every object returned by {@code findMultiple()} is either an unproxied instance of the
701+
* given entity class, or a fully-fetched proxy object.
702702
* <p>
703703
* For more advanced cases, use {@link #byMultipleIds(Class)}, which returns an instance of
704704
* {@link MultiIdentifierLoadAccess}.
@@ -711,7 +711,7 @@ public interface Session extends SharedSessionContract, EntityManager {
711711
* @see #byMultipleIds(Class)
712712
* @since 7.0
713713
*/
714-
<E> List<E> findAll(Class<E> entityType, List<Object> ids, FindOption... options);
714+
<E> List<E> findMultiple(Class<E> entityType, List<Object> ids, FindOption... options);
715715

716716
/**
717717
* Return the persistent instance of the given entity class with the given identifier,
@@ -922,7 +922,7 @@ public interface Session extends SharedSessionContract, EntityManager {
922922
*
923923
* @throws HibernateException If the given class does not resolve as a mapped entity
924924
*
925-
* @see #findAll(Class, List, FindOption...)
925+
* @see #findMultiple(Class, List, FindOption...)
926926
*/
927927
<T> MultiIdentifierLoadAccess<T> byMultipleIds(Class<T> entityClass);
928928

hibernate-core/src/main/java/org/hibernate/StatelessSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public interface StatelessSession extends SharedSessionContract {
263263
* null elements representing missing entities
264264
* @since 7.0
265265
*/
266-
<T> List<T> getAll(Class<T> entityClass, List<Object> ids);
266+
<T> List<T> getMultiple(Class<T> entityClass, List<Object> ids);
267267

268268
/**
269269
* Refresh the entity instance state from the database.

hibernate-core/src/main/java/org/hibernate/engine/spi/SessionDelegatorBaseImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,8 +952,8 @@ public void detach(Object entity) {
952952
}
953953

954954
@Override
955-
public <E> List<E> findAll(Class<E> entityType, List<Object> ids, FindOption... options) {
956-
return delegate.findAll( entityType, ids, options );
955+
public <E> List<E> findMultiple(Class<E> entityType, List<Object> ids, FindOption... options) {
956+
return delegate.findMultiple( entityType, ids, options );
957957
}
958958

959959
@Override

hibernate-core/src/main/java/org/hibernate/engine/spi/SessionLazyDelegator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ public void clear() {
262262
}
263263

264264
@Override
265-
public <E> List<E> findAll(Class<E> entityType, List<Object> ids, FindOption... options) {
266-
return this.lazySession.get().findAll( entityType, ids, options );
265+
public <E> List<E> findMultiple(Class<E> entityType, List<Object> ids, FindOption... options) {
266+
return this.lazySession.get().findMultiple( entityType, ids, options );
267267
}
268268

269269
@Override

hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ else if ( option instanceof ReadOnlyMode ) {
988988
}
989989

990990
@Override
991-
public <E> List<E> findAll(Class<E> entityType, List<Object> ids, FindOption... options) {
991+
public <E> List<E> findMultiple(Class<E> entityType, List<Object> ids, FindOption... options) {
992992
return multiloadAccessWithOptions( entityType, options ).multiLoad( ids );
993993
}
994994

hibernate-core/src/main/java/org/hibernate/internal/StatelessSessionImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ public <T> T get(
511511
}
512512

513513
@Override
514-
public <T> List<T> getAll(Class<T> entityClass, List<Object> ids) {
514+
public <T> List<T> getMultiple(Class<T> entityClass, List<Object> ids) {
515515
for (Object id : ids) {
516516
if ( id == null ) {
517517
throw new IllegalArgumentException("Null id");

hibernate-core/src/test/java/org/hibernate/orm/test/loading/multiLoad/FindAllFetchProfileTest.java renamed to hibernate-core/src/test/java/org/hibernate/orm/test/loading/multiLoad/FindMultipleFetchProfileTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
import static org.junit.jupiter.api.Assertions.assertTrue;
2626

2727
@SessionFactory
28-
@DomainModel(annotatedClasses = {FindAllFetchProfileTest.Record.class, FindAllFetchProfileTest.Owner.class})
29-
public class FindAllFetchProfileTest {
28+
@DomainModel(annotatedClasses = {FindMultipleFetchProfileTest.Record.class, FindMultipleFetchProfileTest.Owner.class})
29+
public class FindMultipleFetchProfileTest {
3030
@Test void test(SessionFactoryScope scope) {
3131
scope.inTransaction(s-> {
3232
Owner gavin = new Owner("gavin");
@@ -35,15 +35,15 @@ public class FindAllFetchProfileTest {
3535
s.persist(new Record(456L,gavin,"hello mars"));
3636
});
3737
scope.inTransaction(s-> {
38-
List<Record> all = s.findAll(Record.class, List.of(456L, 123L, 2L));
38+
List<Record> all = s.findMultiple(Record.class, List.of(456L, 123L, 2L));
3939
assertEquals("hello mars",all.get(0).message);
4040
assertEquals("hello earth",all.get(1).message);
4141
assertNull(all.get(2));
4242
assertFalse(Hibernate.isInitialized(all.get(0).owner));
4343
assertFalse(Hibernate.isInitialized(all.get(1).owner));
4444
});
4545
scope.inTransaction(s-> {
46-
List<Record> all = s.findAll(Record.class, List.of(456L, 123L),
46+
List<Record> all = s.findMultiple(Record.class, List.of(456L, 123L),
4747
new EnabledFetchProfile("withOwner"));
4848
assertEquals("hello mars",all.get(0).message);
4949
assertEquals("hello earth",all.get(1).message);

hibernate-core/src/test/java/org/hibernate/orm/test/loading/multiLoad/FindAllTest.java renamed to hibernate-core/src/test/java/org/hibernate/orm/test/loading/multiLoad/FindMutipleTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,29 @@
2020
import static org.junit.jupiter.api.Assertions.assertTrue;
2121

2222
@SessionFactory
23-
@DomainModel(annotatedClasses = FindAllTest.Record.class)
24-
public class FindAllTest {
23+
@DomainModel(annotatedClasses = FindMutipleTest.Record.class)
24+
public class FindMutipleTest {
2525
@Test void test(SessionFactoryScope scope) {
2626
scope.inTransaction(s-> {
2727
s.persist(new Record(123L,"hello earth"));
2828
s.persist(new Record(456L,"hello mars"));
2929
});
3030
scope.inTransaction(s-> {
31-
List<Record> all = s.findAll(Record.class, List.of(456L, 123L, 2L));
31+
List<Record> all = s.findMultiple(Record.class, List.of(456L, 123L, 2L));
3232
assertEquals("hello mars",all.get(0).message);
3333
assertEquals("hello earth",all.get(1).message);
3434
assertNull(all.get(2));
3535
});
3636
scope.inTransaction(s-> {
37-
List<Record> all = s.findAll(Record.class, List.of(456L, 123L), READ_ONLY);
37+
List<Record> all = s.findMultiple(Record.class, List.of(456L, 123L), READ_ONLY);
3838
assertEquals("hello mars",all.get(0).message);
3939
assertEquals("hello earth",all.get(1).message);
4040
assertTrue(s.isReadOnly(all.get(0)));
4141
assertTrue(s.isReadOnly(all.get(1)));
4242
});
4343
scope.inTransaction(s-> {
4444
Record record = s.getReference(Record.class, 456L);
45-
List<Record> all = s.findAll(Record.class, List.of(456L, 123L));
45+
List<Record> all = s.findMultiple(Record.class, List.of(456L, 123L));
4646
assertSame(record, all.get(0));
4747
});
4848
}

hibernate-core/src/test/java/org/hibernate/orm/test/stateless/GetAllTest.java renamed to hibernate-core/src/test/java/org/hibernate/orm/test/stateless/GetMultipleTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
import static org.junit.jupiter.api.Assertions.assertNull;
1818

1919
@SessionFactory
20-
@DomainModel(annotatedClasses = GetAllTest.Record.class)
21-
public class GetAllTest {
20+
@DomainModel(annotatedClasses = GetMultipleTest.Record.class)
21+
public class GetMultipleTest {
2222
@Test void test(SessionFactoryScope scope) {
2323
scope.inStatelessTransaction(s-> {
2424
s.insert(new Record(123L,"hello earth"));
2525
s.insert(new Record(456L,"hello mars"));
2626
});
2727
scope.inStatelessTransaction(s-> {
28-
List<Record> all = s.getAll(Record.class, List.of(456L, 123L, 2L));
28+
List<Record> all = s.getMultiple(Record.class, List.of(456L, 123L, 2L));
2929
assertEquals("hello mars",all.get(0).message);
3030
assertEquals("hello earth",all.get(1).message);
3131
assertNull(all.get(2));

0 commit comments

Comments
 (0)