mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-09 04:34:49 +00:00
Fix several tests failing on Oracle 11 and some others on older dbs
This commit is contained in:
parent
e5e1edac2d
commit
8e9df4344e
@ -5,7 +5,6 @@
|
||||
|
||||
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.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 void init(EntityManagerFactoryScope scope) {
|
||||
scope.inTransaction(
|
||||
entityManager -> {
|
||||
ManufacturerCompany manufacturerCompany = new ManufacturerCompany();
|
||||
manufacturerCompany.setId( 1L );
|
||||
manufacturerCompany.setComputerSystem( new ManufacturerComputerSystem() );
|
||||
|
||||
Person person = new Person();
|
||||
@ -85,7 +84,6 @@ public void refreshTest(EntityManagerFactoryScope scope) {
|
||||
@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 void addPerson(Person person) {
|
||||
people.add( person );
|
||||
person.setCompany( this );
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
@Entity(name = "ComputerSystem")
|
||||
@ -106,7 +108,7 @@ public void addPerson(Person person) {
|
||||
@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 void setComputerSystem(ManufacturerComputerSystem computerSystem) {
|
||||
@Entity(name = "Person")
|
||||
public static class Person {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@GeneratedValue
|
||||
private long id;
|
||||
|
||||
private String firstName;
|
||||
|
@ -52,7 +52,7 @@
|
||||
@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 {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user