HHH-11536 - Fix unit tests failing on Oracle

This commit is contained in:
Andrea Boriero 2017-03-07 15:47:42 +00:00
parent 3dda9d7a54
commit 893e9e45c8
6 changed files with 12 additions and 8 deletions

View File

@ -15,6 +15,7 @@ import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.MapsId;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
@ -111,7 +112,8 @@ public class LoadGraphFindByIdTest extends BaseEntityManagerFunctionalTestCase {
private Integer commentCount;
}
@Entity(name = "Users")
@Entity(name = "User")
@Table(name = "USERS")
public static class User {
@Id

View File

@ -24,6 +24,7 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.util.ArrayList;
import java.util.List;
@ -66,7 +67,8 @@ public class LazyInCacheTestTask extends AbstractEnhancerTestTask {
protected void cleanup() {
}
@Entity(name = "Orders")
@Entity(name = "Order")
@Table(name = "ORDERS")
@Cache( usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE )
public static class Order {

View File

@ -12,6 +12,7 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.query.Query;
@ -64,6 +65,7 @@ public class CoalesceTest extends BaseCoreFunctionalTestCase {
@Test
@SkipForDialect( jiraKey = "HHH-10463", value = PostgreSQL81Dialect.class)
@SkipForDialect( jiraKey = "HHH-10463", value = Oracle8iDialect.class)
public void HHH_10463_NullInCoalesce() {
doInHibernate( this::sessionFactory, session -> {
Query query = session.createQuery("from Person p where p.name = coalesce(:name, p.name) ");

View File

@ -8,10 +8,8 @@ package org.hibernate.test.naturalid.inheritance.cache;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table
public class ExtendedEntity extends MyEntity {
public ExtendedEntity() {
}

View File

@ -11,7 +11,6 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
@ -19,7 +18,6 @@ import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NaturalId;
@Entity
@Table
@Cacheable
@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
public class MyEntity {
@ -45,7 +43,7 @@ public class MyEntity {
}
@NaturalId
@Column
@Column(name = "natural_id")
public String getUid() {
return uid;
}

View File

@ -12,6 +12,7 @@ import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SecondaryTable;
import javax.persistence.Table;
import org.hibernate.dialect.H2Dialect;
@ -31,7 +32,8 @@ public class ForeignKeyDefinitionSecondaryTableTest
};
}
@Entity(name = "Users")
@Entity(name = "User")
@Table(name = "USERS")
@SecondaryTable(name = "User_details", foreignKey = @ForeignKey(name = "secondary", foreignKeyDefinition = "foreign key /* FK */ (id) references Users"))
public class User {