Set up entity load graph test according to what's required by Hibernate 6.
As recommended in [0], we now set up our integration tests verifying the application of entity load graphs using a lazy @ManyToOne relationship. [0] https://hibernate.atlassian.net/browse/HHH-15391 Related to #2423.
This commit is contained in:
@@ -92,8 +92,7 @@ import java.util.Set;
|
||||
@Table(name = "SD_User")
|
||||
public class User {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO) private Integer id;
|
||||
@Id @GeneratedValue(strategy = GenerationType.AUTO) private Integer id;
|
||||
private String firstname;
|
||||
private String lastname;
|
||||
private int age;
|
||||
@@ -106,7 +105,7 @@ public class User {
|
||||
|
||||
@ManyToMany private Set<Role> roles;
|
||||
|
||||
@ManyToOne private User manager;
|
||||
@ManyToOne(fetch = FetchType.LAZY) private User manager;
|
||||
|
||||
@Embedded private Address address;
|
||||
|
||||
@@ -372,7 +371,7 @@ public class User {
|
||||
|
||||
User that = (User) obj;
|
||||
|
||||
if (null == this.getId() || null == that.getId()) {
|
||||
if ((null == this.getId()) || (null == that.getId())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ import java.util.List;
|
||||
import org.assertj.core.api.SoftAssertions;
|
||||
import org.junit.Assume;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -94,7 +93,6 @@ public class EntityGraphRepositoryMethodsIntegrationTests {
|
||||
}
|
||||
|
||||
@Test // DATAJPA-612
|
||||
@Disabled // HHH-15391
|
||||
void shouldRespectConfiguredJpaEntityGraph() {
|
||||
|
||||
Assume.assumeTrue(currentEntityManagerIsAJpa21EntityManager(em));
|
||||
|
||||
Reference in New Issue
Block a user