diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/immutable/ImmutableTest.java b/hibernate-core/src/matrix/java/org/hibernate/test/immutable/ImmutableTest.java index bc04677533..10a53b8f79 100755 --- a/hibernate-core/src/matrix/java/org/hibernate/test/immutable/ImmutableTest.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/immutable/ImmutableTest.java @@ -31,11 +31,17 @@ import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.criterion.Projections; +import org.hibernate.dialect.Oracle8iDialect; import org.hibernate.proxy.HibernateProxy; import org.junit.Test; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; +import org.hibernate.type.AbstractSingleColumnStandardBasicType; +import org.hibernate.type.MaterializedClobType; +import org.hibernate.type.TextType; +import org.hibernate.type.descriptor.java.StringTypeDescriptor; +import org.hibernate.type.descriptor.sql.ClobTypeDescriptor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -49,8 +55,21 @@ import static org.junit.Assert.fail; * @author Gavin King */ public class ImmutableTest extends BaseCoreFunctionalTestCase { + private static class TextAsMaterializedClobType extends AbstractSingleColumnStandardBasicType { + public final static TextAsMaterializedClobType INSTANCE = new TextAsMaterializedClobType(); + public TextAsMaterializedClobType() { + super( ClobTypeDescriptor.DEFAULT, TextType.INSTANCE.getJavaTypeDescriptor() ); + } + public String getName() { + return TextType.INSTANCE.getName(); + } + } + @Override public void configure(Configuration cfg) { + if ( Oracle8iDialect.class.isInstance( getDialect() ) ) { + cfg.registerTypeOverride( TextAsMaterializedClobType.INSTANCE ); + } cfg.setProperty( Environment.GENERATE_STATISTICS, "true"); cfg.setProperty( Environment.STATEMENT_BATCH_SIZE, "0" ); } diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/onetoone/formula/OneToOneFormulaTest.java b/hibernate-core/src/matrix/java/org/hibernate/test/onetoone/formula/OneToOneFormulaTest.java index 5f091d3bdc..fbf731266e 100755 --- a/hibernate-core/src/matrix/java/org/hibernate/test/onetoone/formula/OneToOneFormulaTest.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/onetoone/formula/OneToOneFormulaTest.java @@ -33,7 +33,11 @@ import org.hibernate.criterion.Property; import org.junit.Test; +import org.hibernate.dialect.Oracle8iDialect; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; +import org.hibernate.type.AbstractSingleColumnStandardBasicType; +import org.hibernate.type.TextType; +import org.hibernate.type.descriptor.sql.ClobTypeDescriptor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -46,11 +50,24 @@ import static org.junit.Assert.assertTrue; * @author Gavin King */ public class OneToOneFormulaTest extends BaseCoreFunctionalTestCase { + private static class TextAsMaterializedClobType extends AbstractSingleColumnStandardBasicType { + public final static TextAsMaterializedClobType INSTANCE = new TextAsMaterializedClobType(); + public TextAsMaterializedClobType() { + super( ClobTypeDescriptor.DEFAULT, TextType.INSTANCE.getJavaTypeDescriptor() ); + } + public String getName() { + return TextType.INSTANCE.getName(); + } + } + public String[] getMappings() { return new String[] { "onetoone/formula/Person.hbm.xml" }; } public void configure(Configuration cfg) { + if ( Oracle8iDialect.class.isInstance( getDialect() ) ) { + cfg.registerTypeOverride( TextAsMaterializedClobType.INSTANCE ); + } cfg.setProperty(Environment.USE_SECOND_LEVEL_CACHE, "false"); cfg.setProperty(Environment.GENERATE_STATISTICS, "true"); cfg.setProperty(Environment.DEFAULT_BATCH_FETCH_SIZE, "2");