Refactor Lazy/Eager loading examples
This commit is contained in:
parent
2675cbef0f
commit
779188929a
|
@ -1,14 +1,14 @@
|
||||||
package com.baeldung.hibernate.fetching;
|
package com.baeldung.hibernate.fetching;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import com.baeldung.hibernate.fetching.model.OrderDetail;
|
||||||
import java.util.Set;
|
import com.baeldung.hibernate.fetching.view.FetchingAppView;
|
||||||
|
|
||||||
import org.hibernate.Hibernate;
|
import org.hibernate.Hibernate;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import com.baeldung.hibernate.fetching.model.OrderDetailEager;
|
import java.util.Set;
|
||||||
import com.baeldung.hibernate.fetching.model.OrderDetail;
|
|
||||||
import com.baeldung.hibernate.fetching.view.FetchingAppView;
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
public class HibernateFetchingTest {
|
public class HibernateFetchingTest {
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ public class HibernateFetchingTest {
|
||||||
@Test
|
@Test
|
||||||
public void testEagerFetching() {
|
public void testEagerFetching() {
|
||||||
FetchingAppView fav = new FetchingAppView();
|
FetchingAppView fav = new FetchingAppView();
|
||||||
Set<OrderDetailEager> orderDetalSetEager = fav.eagerLoaded();
|
Set<OrderDetail> orderDetalSetEager = fav.eagerLoaded();
|
||||||
assertTrue(Hibernate.isInitialized(orderDetalSetEager));
|
assertTrue(Hibernate.isInitialized(orderDetalSetEager));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue