HHH-16616 Fix test with assertion that requires multiple subtypes

This commit is contained in:
Marco Belladelli 2023-08-02 16:26:41 +02:00
parent b7ba6e731e
commit ca92becf8e
1 changed files with 21 additions and 1 deletions

View File

@ -44,7 +44,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
@DomainModel(annotatedClasses = {
OneToManyJoinFetchDiscriminatorTest.Person.class,
OneToManyJoinFetchDiscriminatorTest.BodyPart.class,
OneToManyJoinFetchDiscriminatorTest.Leg.class
OneToManyJoinFetchDiscriminatorTest.Leg.class,
OneToManyJoinFetchDiscriminatorTest.Arm.class,
})
@JiraKey("HHH-16157")
public class OneToManyJoinFetchDiscriminatorTest {
@ -136,4 +137,23 @@ public class OneToManyJoinFetchDiscriminatorTest {
return person;
}
}
@Entity(name = "Arm")
@DiscriminatorValue("ArmBodyPart")
public static class Arm extends BodyPart {
@ManyToOne(fetch = FetchType.LAZY, optional = false)
private Person person;
public Arm() {
}
public Arm(String name, Person person) {
this.name = name;
this.person = person;
}
public Person getPerson() {
return person;
}
}
}