diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/basic/NationalizedTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/basic/NationalizedTest.java index 92677fca47..4dd0a0119f 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/basic/NationalizedTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/basic/NationalizedTest.java @@ -10,6 +10,8 @@ import jakarta.persistence.Id; import org.hibernate.annotations.Nationalized; import org.hibernate.orm.test.jpa.BaseEntityManagerFunctionalTestCase; +import org.hibernate.testing.orm.junit.DialectFeatureChecks; +import org.hibernate.testing.orm.junit.RequiresDialectFeature; import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInJPA; @@ -18,6 +20,7 @@ import static org.junit.Assert.assertEquals; /** * @author Vlad Mihalcea */ +@RequiresDialectFeature(feature = DialectFeatureChecks.SupportsUnicodeNClob.class) public class NationalizedTest extends BaseEntityManagerFunctionalTestCase { @Override diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectFeatureChecks.java b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectFeatureChecks.java index 32ba62a309..174ae834d0 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectFeatureChecks.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectFeatureChecks.java @@ -66,6 +66,7 @@ import org.hibernate.dialect.OracleDialect; import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.dialect.SQLServerDialect; import org.hibernate.dialect.SpannerDialect; +import org.hibernate.dialect.SybaseASEDialect; import org.hibernate.dialect.SybaseDialect; import org.hibernate.dialect.SybaseDriverKind; import org.hibernate.dialect.TiDBDialect; @@ -1023,6 +1024,15 @@ abstract public class DialectFeatureChecks { } } + public static class SupportsUnicodeNClob implements DialectFeatureCheck { + @Override + public boolean apply(Dialect dialect) { + return !(dialect instanceof SybaseASEDialect aseDialect) + // The jconn driver apparently doesn't support unicode characters + || aseDialect.getDriverKind() == SybaseDriverKind.JTDS; + } + } + private static final HashMap FUNCTION_REGISTRIES = new HashMap<>(); public static boolean definesFunction(Dialect dialect, String functionName) {