[BAEL-4056] Guide to MultipleBagFetchException (#10304)

* Removes DummyEntity
* Uses Artist Entity instead of DummyEntity
This commit is contained in:
Emmanuel Yasa
2020-12-05 10:44:40 +08:00
committed by GitHub
parent 2700958ec0
commit bc281bde2f
3 changed files with 3 additions and 47 deletions
@@ -29,9 +29,9 @@ public class MultipleBagFetchExceptionIntegrationTest {
public void whenFetchingMoreThanOneBag_thenThrowAnException() {
IllegalArgumentException exception =
assertThrows(IllegalArgumentException.class, () -> {
String jpql = "SELECT dummy FROM DummyEntity dummy "
+ "JOIN FETCH dummy.collection1 "
+ "JOIN FETCH dummy.collection2 ";
String jpql = "SELECT artist FROM Artist artist "
+ "JOIN FETCH artist.songs "
+ "JOIN FETCH artist.offers ";
entityManager.createQuery(jpql);
});