Fix failing tests on CockroachDB and Oracle 11

This commit is contained in:
Marco Belladelli 2023-03-31 16:38:45 +02:00
parent 4b8167c7fd
commit bc31a9532a
5 changed files with 9 additions and 6 deletions

View File

@ -21,6 +21,8 @@ import org.junit.jupiter.api.Test;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.JoinTable;
import jakarta.persistence.MappedSuperclass; import jakarta.persistence.MappedSuperclass;
import jakarta.persistence.OneToMany; import jakarta.persistence.OneToMany;
import jakarta.persistence.Table; import jakarta.persistence.Table;
@ -110,6 +112,7 @@ public class GenericMapAssociationTest {
@MappedSuperclass @MappedSuperclass
public static abstract class AbstractParent<K, E> { public static abstract class AbstractParent<K, E> {
@OneToMany @OneToMany
@JoinTable( name = "map_join_table", joinColumns = @JoinColumn( name = "container_id" ) )
private Map<K, E> map; private Map<K, E> map;
public AbstractParent() { public AbstractParent() {

View File

@ -100,7 +100,7 @@ public class CompoundNaturalIdCacheTest {
); );
} }
@Entity(name = "EntityWithSimpleNaturalId") @Entity(name = "SimpleNaturalId")
@NaturalIdCache @NaturalIdCache
public static class EntityWithSimpleNaturalId { public static class EntityWithSimpleNaturalId {
@ -128,7 +128,7 @@ public class CompoundNaturalIdCacheTest {
} }
} }
@Entity(name = "EntityWithCompoundNaturalId") @Entity(name = "CompoundNaturalId")
@NaturalIdCache @NaturalIdCache
public static class EntityWithCompoundNaturalId { public static class EntityWithCompoundNaturalId {

View File

@ -17,7 +17,6 @@ import jakarta.persistence.Entity;
import jakarta.persistence.EnumType; import jakarta.persistence.EnumType;
import jakarta.persistence.FetchType; import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn; import jakarta.persistence.JoinColumn;
import jakarta.persistence.MapKeyColumn; import jakarta.persistence.MapKeyColumn;
@ -54,7 +53,7 @@ public class RefreshWithPropertyAccessAndCollectionMapManipulationInSetterMethod
public static class Car { public static class Car {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue
@Access(AccessType.PROPERTY) @Access(AccessType.PROPERTY)
private Long id; private Long id;

View File

@ -16,7 +16,6 @@ import jakarta.persistence.Column;
import jakarta.persistence.Entity; import jakarta.persistence.Entity;
import jakarta.persistence.FetchType; import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.OneToMany; import jakarta.persistence.OneToMany;
import jakarta.persistence.Table; import jakarta.persistence.Table;
@ -50,7 +49,7 @@ public class RefreshWithPropertyAccessAndListManipulationInSetterMethodTest {
public static class Car { public static class Car {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue
@Access(AccessType.PROPERTY) @Access(AccessType.PROPERTY)
private Long id; private Long id;

View File

@ -8,6 +8,7 @@ package org.hibernate.orm.test.query;
import java.time.LocalDate; import java.time.LocalDate;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.testing.orm.domain.gambit.EntityOfBasics; import org.hibernate.testing.orm.domain.gambit.EntityOfBasics;
@ -69,6 +70,7 @@ public class NamedParameterInSelectAndWhereTest {
@Test @Test
@Jira( "https://hibernate.atlassian.net/browse/HHH-16305" ) @Jira( "https://hibernate.atlassian.net/browse/HHH-16305" )
@SkipForDialect( dialectClass = PostgreSQLDialect.class, reason = "PostgreSQL doesn't support parameters as arguments for timestampdiff" ) @SkipForDialect( dialectClass = PostgreSQLDialect.class, reason = "PostgreSQL doesn't support parameters as arguments for timestampdiff" )
@SkipForDialect( dialectClass = CockroachDialect.class, reason = "CockroachDB doesn't support parameters as arguments for timestampdiff" )
public void testSelectFunctionAndWhere(SessionFactoryScope scope) { public void testSelectFunctionAndWhere(SessionFactoryScope scope) {
scope.inTransaction( session -> assertEquals( 0, session.createQuery( scope.inTransaction( session -> assertEquals( 0, session.createQuery(
"select timestampdiff(year, e.theLocalDate, :date) from EntityOfBasics e where e.theLocalDate <= :date", "select timestampdiff(year, e.theLocalDate, :date) from EntityOfBasics e where e.theLocalDate <= :date",