mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 08:35:13 +00:00
Fix failing tests on CockroachDB and Oracle 11
This commit is contained in:
parent
4b8167c7fd
commit
bc31a9532a
@ -21,6 +21,8 @@
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.JoinTable;
|
||||
import jakarta.persistence.MappedSuperclass;
|
||||
import jakarta.persistence.OneToMany;
|
||||
import jakarta.persistence.Table;
|
||||
@ -110,6 +112,7 @@ public void testValueQuery(SessionFactoryScope scope) {
|
||||
@MappedSuperclass
|
||||
public static abstract class AbstractParent<K, E> {
|
||||
@OneToMany
|
||||
@JoinTable( name = "map_join_table", joinColumns = @JoinColumn( name = "container_id" ) )
|
||||
private Map<K, E> map;
|
||||
|
||||
public AbstractParent() {
|
||||
|
@ -100,7 +100,7 @@ private void loadEntityWithCompoundNaturalId(String firstname, String lastname,
|
||||
);
|
||||
}
|
||||
|
||||
@Entity(name = "EntityWithSimpleNaturalId")
|
||||
@Entity(name = "SimpleNaturalId")
|
||||
@NaturalIdCache
|
||||
public static class EntityWithSimpleNaturalId {
|
||||
|
||||
@ -128,7 +128,7 @@ public void setName(final String name) {
|
||||
}
|
||||
}
|
||||
|
||||
@Entity(name = "EntityWithCompoundNaturalId")
|
||||
@Entity(name = "CompoundNaturalId")
|
||||
@NaturalIdCache
|
||||
public static class EntityWithCompoundNaturalId {
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
import jakarta.persistence.EnumType;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.MapKeyColumn;
|
||||
@ -54,7 +53,7 @@ public void testPersistAndRefresh(SessionFactoryScope scope) {
|
||||
public static class Car {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@GeneratedValue
|
||||
@Access(AccessType.PROPERTY)
|
||||
private Long id;
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.OneToMany;
|
||||
import jakarta.persistence.Table;
|
||||
@ -50,7 +49,7 @@ public void testPersistAndRefresh(SessionFactoryScope scope) {
|
||||
public static class Car {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@GeneratedValue
|
||||
@Access(AccessType.PROPERTY)
|
||||
private Long id;
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
import org.hibernate.dialect.CockroachDialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
|
||||
import org.hibernate.testing.orm.domain.gambit.EntityOfBasics;
|
||||
@ -69,6 +70,7 @@ public void testSelectAndWhereIsNull(SessionFactoryScope scope) {
|
||||
@Test
|
||||
@Jira( "https://hibernate.atlassian.net/browse/HHH-16305" )
|
||||
@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) {
|
||||
scope.inTransaction( session -> assertEquals( 0, session.createQuery(
|
||||
"select timestampdiff(year, e.theLocalDate, :date) from EntityOfBasics e where e.theLocalDate <= :date",
|
||||
|
Loading…
x
Reference in New Issue
Block a user