Fix several tests failing on Oracle 11 and some others on older dbs

This commit is contained in:
Marco Belladelli 2023-05-11 12:34:56 +02:00
parent e5e1edac2d
commit 8e9df4344e
No known key found for this signature in database
GPG Key ID: D1D0C3030AE3AA35
2 changed files with 8 additions and 6 deletions

View File

@ -5,7 +5,6 @@ import java.util.List;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.orm.junit.EntityManagerFactoryScope;
import org.hibernate.testing.orm.junit.JiraKey;
import org.hibernate.testing.orm.junit.Jpa;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@ -18,7 +17,6 @@ import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.ForeignKey;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Inheritance;
import jakarta.persistence.InheritanceType;
@ -47,6 +45,7 @@ public class RefreshAndInheritanceTest {
scope.inTransaction(
entityManager -> {
ManufacturerCompany manufacturerCompany = new ManufacturerCompany();
manufacturerCompany.setId( 1L );
manufacturerCompany.setComputerSystem( new ManufacturerComputerSystem() );
Person person = new Person();
@ -85,7 +84,6 @@ public class RefreshAndInheritanceTest {
@DiscriminatorColumn(name = "CompanyType", discriminatorType = DiscriminatorType.INTEGER)
public static abstract class Company {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
protected long id;
@OneToMany(mappedBy = "company", orphanRemoval = true, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@ -99,6 +97,10 @@ public class RefreshAndInheritanceTest {
people.add( person );
person.setCompany( this );
}
public void setId(long id) {
this.id = id;
}
}
@Entity(name = "ComputerSystem")
@ -106,7 +108,7 @@ public class RefreshAndInheritanceTest {
@DiscriminatorColumn(name = "CompanyType", discriminatorType = DiscriminatorType.INTEGER)
public static abstract class ComputerSystem {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@GeneratedValue
private long id;
@ManyToOne
@ -139,7 +141,7 @@ public class RefreshAndInheritanceTest {
@Entity(name = "Person")
public static class Person {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@GeneratedValue
private long id;
private String firstName;

View File

@ -52,7 +52,7 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
@Setting(name = AvailableSettings.FORMAT_SQL, value = "false")
}
)
@RequiresDialect(H2Dialect.class)
@RequiresDialect(value = H2Dialect.class, majorVersion = 2, comment = "H2 didn't support SQL arrays before version 2")
@JiraKey("HHH-16469")
public class DepthOneBatchTest {