HHH-15178 Introduce internal init_sql config and by default enable ansinull for Sybase ASE

This commit is contained in:
Christian Beikov 2021-09-02 13:08:58 +02:00
parent ebfc6b4254
commit dad493d867
108 changed files with 600 additions and 265 deletions

View File

@ -41,8 +41,7 @@ jobs:
- rdbms: oracle
- rdbms: db2
- rdbms: mssql
# Testing against Sybase requires many backports so let's skip it for now
# - rdbms: sybase
- rdbms: sybase
# Running with HANA requires at least 8GB memory just for the database, which we don't have on GH Actions runners
# - rdbms: hana
steps:

View File

@ -31,6 +31,7 @@ import org.hibernate.dialect.MySQL5Dialect;
import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.type.StringType;
import org.hibernate.userguide.model.AddressType;
@ -1314,6 +1315,7 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase {
@Test
@SkipForDialect(SQLServerDialect.class)
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "current_date requires parenthesis which we don't render")
@SkipForDialect(value = DerbyDialect.class, comment = "Comparisons between 'DATE' and 'TIMESTAMP' are not supported")
public void test_hql_current_date_function_example() {
doInJPA( this::entityManagerFactory, entityManager -> {
@ -1356,6 +1358,7 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase {
}
@Test
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "current_timestamp requires parenthesis which we don't render")
public void test_hql_current_timestamp_function_example() {
doInJPA( this::entityManagerFactory, entityManager -> {
//tag::hql-current-timestamp-function-example[]
@ -1428,6 +1431,7 @@ public class HQLTest extends BaseEntityManagerFunctionalTestCase {
@Test
@SkipForDialect(SQLServerDialect.class)
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "No proper implementation for the STR function available")
public void test_hql_str_function_example() {
doInJPA( this::entityManagerFactory, entityManager -> {
//tag::hql-str-function-example[]

View File

@ -10,8 +10,10 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.SkipForDialect;
import org.junit.Test;
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
@ -20,6 +22,7 @@ import static org.junit.Assert.assertArrayEquals;
/**
* @author Vlad Mihalcea
*/
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement character stream handling")
public class ClobCharArrayTest extends BaseEntityManagerFunctionalTestCase {
@Override

View File

@ -10,8 +10,10 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.SkipForDialect;
import org.junit.Test;
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
@ -20,6 +22,7 @@ import static org.junit.Assert.assertEquals;
/**
* @author Vlad Mihalcea
*/
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement character stream handling")
public class ClobStringTest extends BaseEntityManagerFunctionalTestCase {
@Override

View File

@ -16,9 +16,11 @@ import javax.persistence.Id;
import javax.persistence.Lob;
import org.hibernate.Session;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.engine.jdbc.ClobProxy;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.SkipForDialect;
import org.junit.Test;
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
@ -28,6 +30,7 @@ import static org.junit.Assert.fail;
/**
* @author Vlad Mihalcea
*/
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement character stream handling")
public class ClobTest extends BaseEntityManagerFunctionalTestCase {
@Override

View File

@ -14,6 +14,7 @@ import org.hibernate.annotations.Nationalized;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.MySQL5Dialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.SkipForDialect;
@ -33,6 +34,7 @@ import static org.junit.Assert.assertArrayEquals;
},
comment = "@see https://hibernate.atlassian.net/browse/HHH-10693 and https://hibernate.atlassian.net/browse/HHH-10695 and https://hibernate.atlassian.net/browse/HHH-10473"
)
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement nationalized handling")
public class NClobCharArrayTest extends BaseEntityManagerFunctionalTestCase {
@Override

View File

@ -14,6 +14,7 @@ import org.hibernate.annotations.Nationalized;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.MySQL5Dialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.SkipForDialect;
@ -33,6 +34,7 @@ import static org.junit.Assert.assertEquals;
},
comment = "@see https://hibernate.atlassian.net/browse/HHH-10693 and https://hibernate.atlassian.net/browse/HHH-10695 and https://hibernate.atlassian.net/browse/HHH-10473"
)
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement nationalized handling")
public class NClobStringTest extends BaseEntityManagerFunctionalTestCase {
@Override

View File

@ -22,6 +22,7 @@ import org.hibernate.dialect.CockroachDB192Dialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.MySQL5Dialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.engine.jdbc.NClobProxy;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
@ -45,6 +46,7 @@ import static org.junit.Assert.fail;
},
comment = "@see https://hibernate.atlassian.net/browse/HHH-10693 and https://hibernate.atlassian.net/browse/HHH-10695 and https://hibernate.atlassian.net/browse/HHH-10473"
)
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement nationalized handling")
public class NClobTest extends BaseEntityManagerFunctionalTestCase {
@Override

View File

@ -12,6 +12,7 @@ import javax.persistence.Id;
import org.hibernate.annotations.Nationalized;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.SkipForDialect;
@ -30,6 +31,7 @@ import static org.junit.Assert.assertEquals;
},
comment = "@see https://hibernate.atlassian.net/browse/HHH-10693 and Derby doesn't support nationalized type"
)
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement nationalized handling")
public class NationalizedTest extends BaseEntityManagerFunctionalTestCase {
@Override

View File

@ -16,6 +16,7 @@ import javax.persistence.Table;
import org.hibernate.annotations.Subselect;
import org.hibernate.annotations.Synchronize;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.SkipForDialect;
@ -28,6 +29,7 @@ import static org.junit.Assert.assertEquals;
* @author Vlad Mihalcea
*/
@SkipForDialect(value = DerbyDialect.class, comment = "Derby doesn't support a CONCAT function")
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Sybase doesn't support a CONCAT function")
public class SubselectTest extends BaseEntityManagerFunctionalTestCase {
@Override

View File

@ -15,11 +15,13 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import org.hibernate.annotations.ValueGenerationType;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.tuple.AnnotationValueGeneration;
import org.hibernate.tuple.GenerationTiming;
import org.hibernate.tuple.ValueGenerator;
import org.hibernate.testing.SkipForDialect;
import org.junit.Test;
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
@ -27,6 +29,7 @@ import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
/**
* @author Vlad Mihalcea
*/
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "current_timestamp requires parenthesis which we don't render")
public class DatabaseValueGenerationTest extends BaseEntityManagerFunctionalTestCase {
@Override

View File

@ -10,6 +10,8 @@ import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature;
import org.junit.Test;
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
@ -17,6 +19,7 @@ import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
/**
* @author Vlad Mihalcea
*/
@RequiresDialectFeature(DialectChecks.SupportsCascadeDeleteCheck.class)
public class CascadeOnDeleteTest extends BaseEntityManagerFunctionalTestCase {
@Override

View File

@ -19,9 +19,11 @@ import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.exception.ConstraintViolationException;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.util.ExceptionUtil;
import org.junit.Test;
@ -44,6 +46,7 @@ public class UniqueConstraintTest extends BaseEntityManagerFunctionalTestCase {
}
@Test
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Missing constraint violation extractor")
public void test() {
//tag::schema-generation-columns-unique-constraint-persist-example[]
Author _author = doInJPA( this::entityManagerFactory, entityManager -> {

View File

@ -10,6 +10,7 @@ hibernate.connection.driver_class @jdbc.driver@
hibernate.connection.url @jdbc.url@
hibernate.connection.username @jdbc.user@
hibernate.connection.password @jdbc.pass@
hibernate.connection.init_sql @connection.init_sql@
hibernate.connection.pool_size 5

View File

@ -16,20 +16,23 @@ ext {
'jdbc.user' : 'sa',
'jdbc.pass' : '',
'jdbc.url' : 'jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;LOCK_TIMEOUT=10000',
'connection.init_sql' : ''
],
hsqldb : [
'db.dialect' : 'org.hibernate.dialect.HSQLDialect',
'jdbc.driver': 'org.hsqldb.jdbc.JDBCDriver',
'jdbc.user' : 'sa',
'jdbc.pass' : '',
'jdbc.url' : 'jdbc:hsqldb:mem:test'
'jdbc.url' : 'jdbc:hsqldb:mem:test',
'connection.init_sql' : ''
],
derby : [
'db.dialect' : 'org.hibernate.dialect.DerbyTenSevenDialect',
'jdbc.driver': 'org.apache.derby.jdbc.EmbeddedDriver',
'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test',
'jdbc.url' : 'jdbc:derby:target/tmp/derby/hibernate_orm_test;databaseName=hibernate_orm_test;create=true'
'jdbc.url' : 'jdbc:derby:target/tmp/derby/hibernate_orm_test;databaseName=hibernate_orm_test;create=true',
'connection.init_sql' : ''
],
pgsql : [
'db.dialect' : 'org.hibernate.dialect.PostgreSQL95Dialect',
@ -37,7 +40,8 @@ ext {
'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test',
// Disable prepared statement caching due to https://www.postgresql.org/message-id/CAEcMXhmmRd4-%2BNQbnjDT26XNdUoXdmntV9zdr8%3DTu8PL9aVCYg%40mail.gmail.com
'jdbc.url' : 'jdbc:postgresql://' + dbHost + '/hibernate_orm_test?preparedStatementCacheQueries=0'
'jdbc.url' : 'jdbc:postgresql://' + dbHost + '/hibernate_orm_test?preparedStatementCacheQueries=0',
'connection.init_sql' : ''
],
pgsql_docker : [
'db.dialect' : 'org.hibernate.dialect.PostgreSQL10Dialect',
@ -45,7 +49,8 @@ ext {
'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test',
// Disable prepared statement caching due to https://www.postgresql.org/message-id/CAEcMXhmmRd4-%2BNQbnjDT26XNdUoXdmntV9zdr8%3DTu8PL9aVCYg%40mail.gmail.com
'jdbc.url' : 'jdbc:postgresql://' + dbHost + '/hibernate_orm_test?preparedStatementCacheQueries=0'
'jdbc.url' : 'jdbc:postgresql://' + dbHost + '/hibernate_orm_test?preparedStatementCacheQueries=0',
'connection.init_sql' : ''
],
pgsql_ci : [
'db.dialect' : 'org.hibernate.dialect.PostgreSQL95Dialect',
@ -53,7 +58,8 @@ ext {
'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test',
// Disable prepared statement caching due to https://www.postgresql.org/message-id/CAEcMXhmmRd4-%2BNQbnjDT26XNdUoXdmntV9zdr8%3DTu8PL9aVCYg%40mail.gmail.com
'jdbc.url' : 'jdbc:postgresql://' + dbHost + '/hibernate_orm_test?preparedStatementCacheQueries=0'
'jdbc.url' : 'jdbc:postgresql://' + dbHost + '/hibernate_orm_test?preparedStatementCacheQueries=0',
'connection.init_sql' : ''
],
sybase_ci : [
'db.dialect' : 'org.hibernate.dialect.SybaseASE157Dialect',
@ -69,14 +75,16 @@ ext {
'jdbc.driver': 'com.mysql.jdbc.Driver',
'jdbc.user' : 'hibernateormtest',
'jdbc.pass' : 'hibernateormtest',
'jdbc.url' : 'jdbc:mysql://' + dbHost + '/hibernate_orm_test'
'jdbc.url' : 'jdbc:mysql://' + dbHost + '/hibernate_orm_test',
'connection.init_sql' : ''
],
mysql_docker : [
'db.dialect' : 'org.hibernate.dialect.MySQL57Dialect',
'jdbc.driver': 'com.mysql.jdbc.Driver',
'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test',
'jdbc.url' : 'jdbc:mysql://' + dbHost + '/hibernate_orm_test?useSSL=false'
'jdbc.url' : 'jdbc:mysql://' + dbHost + '/hibernate_orm_test?useSSL=false',
'connection.init_sql' : ''
],
mysql_ci : [
'db.dialect' : 'org.hibernate.dialect.MySQL8Dialect',
@ -92,28 +100,32 @@ ext {
'jdbc.driver': 'com.mysql.cj.jdbc.Driver',
'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test',
'jdbc.url' : 'jdbc:mysql://' + dbHost + '/hibernate_orm_test?allowPublicKeyRetrieval=true&useSSL=false'
'jdbc.url' : 'jdbc:mysql://' + dbHost + '/hibernate_orm_test?allowPublicKeyRetrieval=true&useSSL=false',
'connection.init_sql' : ''
],
mariadb : [
'db.dialect' : 'org.hibernate.dialect.MariaDB103Dialect',
'jdbc.driver': 'org.mariadb.jdbc.Driver',
'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test',
'jdbc.url' : 'jdbc:mariadb://' + dbHost + '/hibernate_orm_test'
'jdbc.url' : 'jdbc:mariadb://' + dbHost + '/hibernate_orm_test',
'connection.init_sql' : ''
],
mariadb_ci : [
'db.dialect' : 'org.hibernate.dialect.MariaDB103Dialect',
'jdbc.driver': 'org.mariadb.jdbc.Driver',
'jdbc.user' : 'root',
'jdbc.pass' : 'hibernate_orm_test',
'jdbc.url' : 'jdbc:mariadb://' + dbHost + '/hibernate_orm_test'
'jdbc.url' : 'jdbc:mariadb://' + dbHost + '/hibernate_orm_test',
'connection.init_sql' : ''
],
mariadb_spatial_ci : [
'db.dialect' : 'org.hibernate.spatial.dialect.mariadb.MariaDB103SpatialDialect',
'jdbc.driver': 'org.mariadb.jdbc.Driver',
'jdbc.user' : 'root',
'jdbc.pass' : 'hibernate_orm_test',
'jdbc.url' : 'jdbc:mariadb://' + dbHost + '/hibernate_orm_test'
'jdbc.url' : 'jdbc:mariadb://' + dbHost + '/hibernate_orm_test',
'connection.init_sql' : ''
],
postgis : [
'db.dialect' : 'org.hibernate.spatial.dialect.postgis.PostgisPG95Dialect',
@ -121,14 +133,16 @@ ext {
'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test',
// Disable prepared statement caching due to https://www.postgresql.org/message-id/CAEcMXhmmRd4-%2BNQbnjDT26XNdUoXdmntV9zdr8%3DTu8PL9aVCYg%40mail.gmail.com
'jdbc.url' : 'jdbc:postgresql://' + dbHost + '/hibernate_orm_test?preparedStatementCacheQueries=0'
'jdbc.url' : 'jdbc:postgresql://' + dbHost + '/hibernate_orm_test?preparedStatementCacheQueries=0',
'connection.init_sql' : ''
],
oracle : [
'db.dialect' : 'org.hibernate.dialect.Oracle10gDialect',
'jdbc.driver': 'oracle.jdbc.OracleDriver',
'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test',
'jdbc.url' : 'jdbc:oracle:thin:@' + dbHost + ':1521/xe'
'jdbc.url' : 'jdbc:oracle:thin:@' + dbHost + ':1521/xe',
'connection.init_sql' : ''
],
oracle_jenkins : [
'db.dialect' : 'org.hibernate.dialect.Oracle12cDialect',
@ -144,70 +158,80 @@ ext {
'jdbc.driver': 'oracle.jdbc.OracleDriver',
'jdbc.user' : 'c##hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test',
'jdbc.url' : 'jdbc:oracle:thin:@' + dbHost + ':1521/ORCLPDB1.localdomain'
'jdbc.url' : 'jdbc:oracle:thin:@' + dbHost + ':1521/ORCLPDB1.localdomain',
'connection.init_sql' : ''
],
oracle_ci : [
'db.dialect' : 'org.hibernate.dialect.Oracle12cDialect',
'jdbc.driver': 'oracle.jdbc.OracleDriver',
'jdbc.user' : 'SYSTEM',
'jdbc.pass' : 'Oracle18',
'jdbc.url' : 'jdbc:oracle:thin:@' + dbHost + ':1521:XE'
'jdbc.url' : 'jdbc:oracle:thin:@' + dbHost + ':1521:XE',
'connection.init_sql' : ''
],
oracle_spatial_ci : [
'db.dialect' : 'org.hibernate.spatial.dialect.oracle.OracleSpatial10gDialect',
'jdbc.driver': 'oracle.jdbc.OracleDriver',
'jdbc.user' : 'SYSTEM',
'jdbc.pass' : 'Oracle18',
'jdbc.url' : 'jdbc:oracle:thin:@' + dbHost + ':1521:XE'
'jdbc.url' : 'jdbc:oracle:thin:@' + dbHost + ':1521:XE',
'connection.init_sql' : ''
],
mssql : [
'db.dialect' : 'org.hibernate.dialect.SQLServer2012Dialect',
'jdbc.driver': 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
'jdbc.user' : 'hibernate_orm_test',
'jdbc.pass' : 'hibernate_orm_test',
'jdbc.url' : 'jdbc:sqlserver://' + dbHost + ';instance=SQLEXPRESS;databaseName=hibernate_orm_test'
'jdbc.url' : 'jdbc:sqlserver://' + dbHost + ';instance=SQLEXPRESS;databaseName=hibernate_orm_test',
'connection.init_sql' : ''
],
mssql_ci : [
'db.dialect' : 'org.hibernate.dialect.SQLServer2012Dialect',
'jdbc.driver': 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
'jdbc.user' : 'sa',
'jdbc.pass' : 'Hibernate_orm_test',
'jdbc.url' : 'jdbc:sqlserver://' + dbHost + ';databaseName=hibernate_orm_test;sendTimeAsDatetime=false'
'jdbc.url' : 'jdbc:sqlserver://' + dbHost + ';databaseName=hibernate_orm_test;sendTimeAsDatetime=false',
'connection.init_sql' : ''
],
mssql_spatial_ci : [
'db.dialect' : 'org.hibernate.spatial.dialect.sqlserver.SqlServer2012SpatialDialect',
'jdbc.driver': 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
'jdbc.user' : 'sa',
'jdbc.pass' : 'Hibernate_orm_test',
'jdbc.url' : 'jdbc:sqlserver://' + dbHost + ';databaseName=hibernate_orm_test'
'jdbc.url' : 'jdbc:sqlserver://' + dbHost + ';databaseName=hibernate_orm_test',
'connection.init_sql' : ''
],
informix : [
'db.dialect' : 'org.hibernate.dialect.InformixDialect',
'jdbc.driver': 'com.informix.jdbc.IfxDriver',
'jdbc.user' : 'informix',
'jdbc.pass' : 'in4mix',
'jdbc.url' : 'jdbc:informix-sqli://' + dbHost + ':9088/sysuser:INFORMIXSERVER=dev;user=informix;password=in4mix'
'jdbc.url' : 'jdbc:informix-sqli://' + dbHost + ':9088/sysuser:INFORMIXSERVER=dev;user=informix;password=in4mix',
'connection.init_sql' : ''
],
db2 : [
'db.dialect' : 'org.hibernate.dialect.DB2Dialect',
'jdbc.driver': 'com.ibm.db2.jcc.DB2Driver',
'jdbc.user' : 'db2inst1',
'jdbc.pass' : 'db2inst1-pwd',
'jdbc.url' : 'jdbc:db2://' + dbHost + ':50000/hibern8'
'jdbc.url' : 'jdbc:db2://' + dbHost + ':50000/hibern8',
'connection.init_sql' : ''
],
db2_ci : [
'db.dialect' : 'org.hibernate.dialect.DB2Dialect',
'jdbc.driver': 'com.ibm.db2.jcc.DB2Driver',
'jdbc.user' : 'orm_test',
'jdbc.pass' : 'orm_test',
'jdbc.url' : 'jdbc:db2://' + dbHost + ':50000/orm_test'
'jdbc.url' : 'jdbc:db2://' + dbHost + ':50000/orm_test',
'connection.init_sql' : ''
],
db2_spatial_ci : [
'db.dialect' : 'org.hibernate.spatial.dialect.db2.DB2SpatialDialect',
'jdbc.driver': 'com.ibm.db2.jcc.DB2Driver',
'jdbc.user' : 'orm_test',
'jdbc.pass' : 'orm_test',
'jdbc.url' : 'jdbc:db2://' + dbHost + ':50000/orm_test'
'jdbc.url' : 'jdbc:db2://' + dbHost + ':50000/orm_test',
'connection.init_sql' : ''
],
hana : [
'db.dialect' : 'org.hibernate.dialect.HANAColumnStoreDialect',
@ -215,7 +239,8 @@ ext {
'jdbc.user' : 'HIBERNATE_TEST',
'jdbc.pass' : 'H1bernate_test',
// Disable prepared statement caching due to https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/78f2163887814223858e4369d18e2847.html
'jdbc.url' : 'jdbc:sap://' + dbHost + ':30015/?statementCacheSize=0'
'jdbc.url' : 'jdbc:sap://' + dbHost + ':30015/?statementCacheSize=0',
'connection.init_sql' : ''
],
hana_cloud : [
'db.dialect' : 'org.hibernate.dialect.HANACloudColumnStoreDialect',
@ -223,7 +248,8 @@ ext {
'jdbc.user' : 'HIBERNATE_TEST',
'jdbc.pass' : 'H1bernate_test',
// Disable prepared statement caching due to https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/78f2163887814223858e4369d18e2847.html
'jdbc.url' : 'jdbc:sap://' + dbHost + ':443/?encrypt=true&validateCertificate=false&statementCacheSize=0'
'jdbc.url' : 'jdbc:sap://' + dbHost + ':443/?encrypt=true&validateCertificate=false&statementCacheSize=0',
'connection.init_sql' : ''
],
hana_jenkins : [
'db.dialect' : 'org.hibernate.dialect.HANAColumnStoreDialect',
@ -240,7 +266,8 @@ ext {
'jdbc.user' : 'VLAD',
'jdbc.pass' : 'V1ad_test',
// Disable prepared statement caching due to https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/78f2163887814223858e4369d18e2847.html
'jdbc.url' : 'jdbc:sap://' + dbHost + ':39015/?statementCacheSize=0'
'jdbc.url' : 'jdbc:sap://' + dbHost + ':39015/?statementCacheSize=0',
'connection.init_sql' : ''
],
hana_docker : [
'db.dialect' : 'org.hibernate.dialect.HANAColumnStoreDialect',
@ -248,7 +275,8 @@ ext {
'jdbc.user' : 'SYSTEM',
'jdbc.pass' : 'H1bernate_test',
// Disable prepared statement caching due to https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/78f2163887814223858e4369d18e2847.html
'jdbc.url' : 'jdbc:sap://' + dbHost + ':39017/?statementCacheSize=0'
'jdbc.url' : 'jdbc:sap://' + dbHost + ':39017/?statementCacheSize=0',
'connection.init_sql' : ''
],
hana_ci : [
'db.dialect' : 'org.hibernate.dialect.HANAColumnStoreDialect',
@ -256,7 +284,8 @@ ext {
'jdbc.user' : 'SYSTEM',
'jdbc.pass' : 'H1bernate_test',
// Disable prepared statement caching due to https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/78f2163887814223858e4369d18e2847.html
'jdbc.url' : 'jdbc:sap://' + dbHost + ':39017/?statementCacheSize=0'
'jdbc.url' : 'jdbc:sap://' + dbHost + ':39017/?statementCacheSize=0',
'connection.init_sql' : ''
],
hana_spatial_ci : [
'db.dialect' : 'org.hibernate.spatial.dialect.hana.HANASpatialDialect',
@ -264,7 +293,8 @@ ext {
'jdbc.user' : 'SYSTEM',
'jdbc.pass' : 'H1bernate_test',
// Disable prepared statement caching due to https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/78f2163887814223858e4369d18e2847.html
'jdbc.url' : 'jdbc:sap://' + dbHost + ':39017/?statementCacheSize=0'
'jdbc.url' : 'jdbc:sap://' + dbHost + ':39017/?statementCacheSize=0',
'connection.init_sql' : ''
],
cockroachdb : [
'db.dialect' : 'org.hibernate.dialect.CockroachDB192Dialect',
@ -273,7 +303,8 @@ ext {
'jdbc.user' : 'root',
'jdbc.pass' : '',
// Disable prepared statement caching due to https://www.postgresql.org/message-id/CAEcMXhmmRd4-%2BNQbnjDT26XNdUoXdmntV9zdr8%3DTu8PL9aVCYg%40mail.gmail.com
'jdbc.url' : 'jdbc:postgresql://' + dbHost + ':26257/defaultdb?sslmode=disable&preparedStatementCacheQueries=0'
'jdbc.url' : 'jdbc:postgresql://' + dbHost + ':26257/defaultdb?sslmode=disable&preparedStatementCacheQueries=0',
'connection.init_sql' : ''
],
cockroachdb_spatial : [
'db.dialect' : 'org.hibernate.spatial.dialect.cockroachdb.CockroachDB202SpatialDialect',
@ -282,7 +313,8 @@ ext {
'jdbc.user' : 'root',
'jdbc.pass' : '',
// Disable prepared statement caching due to https://www.postgresql.org/message-id/CAEcMXhmmRd4-%2BNQbnjDT26XNdUoXdmntV9zdr8%3DTu8PL9aVCYg%40mail.gmail.com
'jdbc.url' : 'jdbc:postgresql://' + dbHost + ':26257/defaultdb?sslmode=disable&preparedStatementCacheQueries=0'
'jdbc.url' : 'jdbc:postgresql://' + dbHost + ':26257/defaultdb?sslmode=disable&preparedStatementCacheQueries=0',
'connection.init_sql' : ''
]
]
}

View File

@ -9,6 +9,7 @@ hibernate.connection.driver_class @jdbc.driver@
hibernate.connection.url @jdbc.url@
hibernate.connection.username @jdbc.user@
hibernate.connection.password @jdbc.pass@
hibernate.connection.init_sql @connection.init_sql@
hibernate.jdbc.batch_size 10
hibernate.connection.provider_class AgroalConnectionProvider

View File

@ -9,6 +9,7 @@ hibernate.connection.driver_class @jdbc.driver@
hibernate.connection.url @jdbc.url@
hibernate.connection.username @jdbc.user@
hibernate.connection.password @jdbc.pass@
hibernate.connection.init_sql @connection.init_sql@
hibernate.connection.pool_size 5
hibernate.c3p0.min_size 50

View File

@ -50,6 +50,12 @@ public class SybaseDialect extends AbstractTransactSQLDialect {
return " null";
}
@Override
public boolean canCreateSchema() {
// As far as I can tell, it does not
return false;
}
@Override
public String getCurrentSchemaCommand() {
return "select db_name()";

View File

@ -8,6 +8,7 @@ package org.hibernate.engine.jdbc.connections.internal;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
import org.hibernate.HibernateException;
@ -34,18 +35,21 @@ public abstract class BasicConnectionCreator implements ConnectionCreator {
private final boolean autoCommit;
private final Integer isolation;
private final String initSql;
public BasicConnectionCreator(
ServiceRegistryImplementor serviceRegistry,
String url,
Properties connectionProps,
boolean autocommit,
Integer isolation) {
Integer isolation,
String initSql) {
this.serviceRegistry = serviceRegistry;
this.url = url;
this.connectionProps = connectionProps;
this.autoCommit = autocommit;
this.isolation = isolation;
this.initSql = initSql;
}
@Override
@ -78,6 +82,15 @@ public abstract class BasicConnectionCreator implements ConnectionCreator {
throw convertSqlException( "Unable to set auto-commit (" + autoCommit + ")", e );
}
if ( initSql != null && !initSql.trim().isEmpty() ) {
try (Statement s = conn.createStatement()) {
s.execute( initSql );
}
catch (SQLException e) {
throw convertSqlException( "Unable to execute initSql (" + initSql + ")", e );
}
}
return conn;
}

View File

@ -1,62 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.engine.jdbc.connections.internal;
import java.sql.Driver;
import java.util.Properties;
import org.hibernate.service.spi.ServiceRegistryImplementor;
/**
* A builder for ConnectionCreator instances
*
* @author Steve Ebersole
*/
public class ConnectionCreatorBuilder {
private final ServiceRegistryImplementor serviceRegistry;
private Driver driver;
private String url;
private Properties connectionProps;
private boolean autoCommit;
private Integer isolation;
public ConnectionCreatorBuilder(ServiceRegistryImplementor serviceRegistry) {
this.serviceRegistry = serviceRegistry;
}
public void setDriver(Driver driver) {
this.driver = driver;
}
public void setUrl(String url) {
this.url = url;
}
public void setConnectionProps(Properties connectionProps) {
this.connectionProps = connectionProps;
}
public void setAutoCommit(boolean autoCommit) {
this.autoCommit = autoCommit;
}
public void setIsolation(Integer isolation) {
this.isolation = isolation;
}
public ConnectionCreator build() {
if ( driver == null ) {
return new DriverManagerConnectionCreator( serviceRegistry, url, connectionProps, autoCommit, isolation );
}
else {
return new DriverConnectionCreator( driver, serviceRegistry, url, connectionProps, autoCommit, isolation );
}
}
}

View File

@ -0,0 +1,32 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.engine.jdbc.connections.internal;
import java.sql.Driver;
import java.util.Map;
import java.util.Properties;
import org.hibernate.service.spi.ServiceRegistryImplementor;
/**
* A factory for {@link ConnectionCreator}.
*
* @author Christian Beikov
*/
interface ConnectionCreatorFactory {
public ConnectionCreator create(
Driver driver,
ServiceRegistryImplementor serviceRegistry,
String url,
Properties connectionProps,
Boolean autocommit,
Integer isolation,
String initSql,
Map<Object, Object> configurationValues);
}

View File

@ -0,0 +1,59 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.engine.jdbc.connections.internal;
import java.sql.Driver;
import java.util.Map;
import java.util.Properties;
import org.hibernate.service.spi.ServiceRegistryImplementor;
/**
* The default factory for ConnectionCreator instances
*
* @author Christian Beikov
*/
public class ConnectionCreatorFactoryImpl implements ConnectionCreatorFactory {
public static final ConnectionCreatorFactory INSTANCE = new ConnectionCreatorFactoryImpl();
private ConnectionCreatorFactoryImpl() {
}
@Override
public ConnectionCreator create(
Driver driver,
ServiceRegistryImplementor serviceRegistry,
String url,
Properties connectionProps,
Boolean autoCommit,
Integer isolation,
String initSql,
Map<Object, Object> configurationValues) {
if ( driver == null ) {
return new DriverManagerConnectionCreator(
serviceRegistry,
url,
connectionProps,
autoCommit,
isolation,
initSql
);
}
else {
return new DriverConnectionCreator(
driver,
serviceRegistry,
url,
connectionProps,
autoCommit,
isolation,
initSql
);
}
}
}

View File

@ -27,8 +27,9 @@ public class DriverConnectionCreator extends BasicConnectionCreator {
String url,
Properties connectionProps,
Boolean autocommit,
Integer isolation) {
super( serviceRegistry, url, connectionProps, autocommit, isolation );
Integer isolation,
String initSql) {
super( serviceRegistry, url, connectionProps, autocommit, isolation, initSql );
this.driver = driver;
}

View File

@ -24,8 +24,9 @@ public class DriverManagerConnectionCreator extends BasicConnectionCreator {
String url,
Properties connectionProps,
Boolean autocommit,
Integer isolation) {
super( serviceRegistry, url, connectionProps, autocommit, isolation );
Integer isolation,
String initSql) {
super( serviceRegistry, url, connectionProps, autocommit, isolation, initSql );
}
@Override

View File

@ -22,6 +22,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.hibernate.HibernateException;
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.dialect.Database;
import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.CoreMessageLogger;
@ -55,6 +56,8 @@ public class DriverManagerConnectionProviderImpl
public static final String INITIAL_SIZE = "hibernate.connection.initial_pool_size";
// in TimeUnit.SECONDS
public static final String VALIDATION_INTERVAL = "hibernate.connection.pool_validation_interval";
public static final String INIT_SQL ="hibernate.connection.init_sql";
public static final String CONNECTION_CREATOR_FACTORY ="hibernate.connection.creator_factory_class";
private volatile PoolState state;
@ -99,18 +102,19 @@ public class DriverManagerConnectionProviderImpl
}
private static ConnectionCreator buildCreator(Map configurationValues, ServiceRegistryImplementor serviceRegistry) {
final ConnectionCreatorBuilder connectionCreatorBuilder = new ConnectionCreatorBuilder( serviceRegistry );
final String driverClassName = (String) configurationValues.get( AvailableSettings.DRIVER );
connectionCreatorBuilder.setDriver( loadDriverIfPossible( driverClassName, serviceRegistry ) );
final String url = (String) configurationValues.get( AvailableSettings.URL );
String driverClassName = (String) configurationValues.get( AvailableSettings.DRIVER );
Driver driver = null;
if ( driverClassName != null ) {
driver = loadDriverIfPossible( driverClassName, serviceRegistry );
}
if ( url == null ) {
final String msg = log.jdbcUrlNotSpecified( AvailableSettings.URL );
log.error( msg );
throw new HibernateException( msg );
}
connectionCreatorBuilder.setUrl( url );
log.usingDriver( driverClassName, url );
@ -123,19 +127,38 @@ public class DriverManagerConnectionProviderImpl
else {
log.connectionProperties( ConfigurationHelper.maskOut( connectionProps, "password" ) );
}
connectionCreatorBuilder.setConnectionProps( connectionProps );
final boolean autoCommit = ConfigurationHelper.getBoolean( AvailableSettings.AUTOCOMMIT, configurationValues, false );
log.autoCommitMode( autoCommit );
connectionCreatorBuilder.setAutoCommit( autoCommit );
final Integer isolation = ConnectionProviderInitiator.extractIsolation( configurationValues );
if ( isolation != null ) {
log.jdbcIsolationLevel( ConnectionProviderInitiator.toIsolationNiceName( isolation ) );
}
connectionCreatorBuilder.setIsolation( isolation );
return connectionCreatorBuilder.build();
final String initSql = (String) configurationValues.get( INIT_SQL );
final Object connectionCreatorFactory = configurationValues.get( CONNECTION_CREATOR_FACTORY );
ConnectionCreatorFactory factory = null;
if ( connectionCreatorFactory instanceof ConnectionCreatorFactory ) {
factory = (ConnectionCreatorFactory) connectionCreatorFactory;
}
else if ( connectionCreatorFactory != null ) {
factory = loadConnectionCreatorFactory( connectionCreatorFactory.toString(), serviceRegistry );
}
if ( factory == null ) {
factory = ConnectionCreatorFactoryImpl.INSTANCE;
}
return factory.create(
driver,
serviceRegistry,
url,
connectionProps,
autoCommit,
isolation,
initSql,
configurationValues
);
}
private static Driver loadDriverIfPossible(String driverClassName, ServiceRegistryImplementor serviceRegistry) {
@ -163,6 +186,31 @@ public class DriverManagerConnectionProviderImpl
}
}
private static ConnectionCreatorFactory loadConnectionCreatorFactory(String connectionCreatorFactoryClassName, ServiceRegistryImplementor serviceRegistry) {
if ( connectionCreatorFactoryClassName == null ) {
log.debug( "No connection creator factory class specified" );
return null;
}
if ( serviceRegistry != null ) {
final ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
final Class<ConnectionCreatorFactory> factoryClass = classLoaderService.classForName( connectionCreatorFactoryClassName );
try {
return factoryClass.newInstance();
}
catch ( Exception e ) {
throw new ServiceException( "Specified ConnectionCreatorFactory " + connectionCreatorFactoryClassName + " could not be loaded", e );
}
}
try {
return (ConnectionCreatorFactory) Class.forName( connectionCreatorFactoryClassName ).newInstance();
}
catch ( Exception e1 ) {
throw new ServiceException( "Specified ConnectionCreatorFactory " + connectionCreatorFactoryClassName + " could not be loaded", e1 );
}
}
// use the pool ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -14,6 +14,7 @@
<property name="hibernate.connection.driver_class">org.h2.Driver</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.connection.init_sql"></property>
<property name="hibernate.connection.url">jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.cache.region_prefix">hibernate.test</property>

View File

@ -20,6 +20,7 @@
<property name="hibernate.connection.username" value="@jdbc.user@"/>
<property name="hibernate.connection.password" value="@jdbc.pass@"/>
<property name="hibernate.connection.url" value="@jdbc.url@"/>
<property name="hibernate.connection.init_sql" value="@connection.init_sql@"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.cache.region.factory_class" value="org.hibernate.testing.cache.CachingRegionFactory" />
</properties>

View File

@ -19,6 +19,7 @@
<property name="hibernate.connection.username" value="@jdbc.user@"/>
<property name="hibernate.connection.password" value="@jdbc.pass@"/>
<property name="hibernate.connection.url" value="@jdbc.url@"/>
<property name="hibernate.connection.init_sql" value="@connection.init_sql@"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.cache.region.factory_class" value="org.hibernate.testing.cache.CachingRegionFactory" />
</properties>

View File

@ -19,6 +19,7 @@
<property name="hibernate.connection.username" value="@jdbc.user@"/>
<property name="hibernate.connection.password" value="@jdbc.pass@"/>
<property name="hibernate.connection.url" value="@jdbc.url@"/>
<property name="hibernate.connection.init_sql" value="@connection.init_sql@"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.cache.region.factory_class" value="org.hibernate.testing.cache.CachingRegionFactory" />
<property name="hibernate.archive.autodetection" value="class"/>

View File

@ -25,6 +25,7 @@
<property name="hibernate.connection.username" value="@jdbc.user@"/>
<property name="hibernate.connection.password" value="@jdbc.pass@"/>
<property name="hibernate.connection.url" value="@jdbc.url@"/>
<property name="hibernate.connection.init_sql" value="@connection.init_sql@"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
<property name="hibernate.cache.region_prefix" value="hibernate.test"/>
<property name="hibernate.jdbc.use_streams_for_binary" value="true"/>

View File

@ -28,6 +28,7 @@
<property name="hibernate.connection.username" value="@jdbc.user@"/>
<property name="hibernate.connection.password" value="@jdbc.pass@"/>
<property name="hibernate.connection.url" value="@jdbc.url@"/>
<property name="hibernate.connection.init_sql" value="@connection.init_sql@"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
<property name="hibernate.cache.region_prefix" value="hibernate.test"/>
<property name="hibernate.jdbc.use_streams_for_binary" value="true"/>

View File

@ -18,6 +18,7 @@
<property name="hibernate.connection.username" value="@jdbc.user@"/>
<property name="hibernate.connection.password" value="@jdbc.pass@"/>
<property name="hibernate.connection.url" value="@jdbc.url@"/>
<property name="hibernate.connection.init_sql" value="@connection.init_sql@"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.cache.region.factory_class" value="org.hibernate.testing.cache.CachingRegionFactory" />
</properties>

View File

@ -7,4 +7,5 @@
hibernate.connection.driver_class @jdbc.driver@
hibernate.connection.url @jdbc.url@
hibernate.connection.username @jdbc.user@
hibernate.connection.password @jdbc.pass@
hibernate.connection.password @jdbc.pass@
hibernate.connection.init_sql @connection.init_sql@

View File

@ -18,6 +18,7 @@
<property name="hibernate.connection.username" value="@jdbc.user@"/>
<property name="hibernate.connection.password" value="@jdbc.pass@"/>
<property name="hibernate.connection.url" value="@jdbc.url@"/>
<property name="hibernate.connection.init_sql" value="@connection.init_sql@"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.cache.region.factory_class" value="org.hibernate.testing.cache.CachingRegionFactory" />
</properties>

View File

@ -19,6 +19,7 @@
<property name="hibernate.connection.username" value="@jdbc.user@"/>
<property name="hibernate.connection.password" value="@jdbc.pass@"/>
<property name="hibernate.connection.url" value="@jdbc.url@"/>
<property name="hibernate.connection.init_sql" value="@connection.init_sql@"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.cache.region.factory_class" value="org.hibernate.testing.cache.CachingRegionFactory" />
</properties>

View File

@ -20,6 +20,8 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.CockroachDB192Dialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -63,6 +65,7 @@ public class ReadWriteCacheTest extends BaseCoreFunctionalTestCase {
@Test
@SkipForDialect(value = CockroachDB192Dialect.class, comment = "CockroachDB uses SERIALIZABLE isolation, and does not support this")
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Sybase seems to block on acquiring a SHARE lock when a different TX upgraded a SHARE to EXCLUSIVE lock, maybe the upgrade caused a table lock?")
public void testDelete() throws InterruptedException {
bookId = 1L;
@ -140,6 +143,7 @@ public class ReadWriteCacheTest extends BaseCoreFunctionalTestCase {
@Test
@SkipForDialect(value = CockroachDB192Dialect.class, comment = "CockroachDB uses SERIALIZABLE isolation, and does not support this")
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Sybase seems to block on acquiring a SHARE lock when a different TX upgraded a SHARE to EXCLUSIVE lock, maybe the upgrade caused a table lock?")
public void testUpdate() throws InterruptedException {
bookId = 4L;

View File

@ -56,6 +56,7 @@ public class ConnectionCreatorTest extends BaseUnitTestCase {
"jdbc:h2:mem:test-bad-urls;nosuchparam=saywhat",
new Properties(),
false,
null,
null
);

View File

@ -17,6 +17,7 @@ import javax.persistence.criteria.CriteriaQuery;
import org.hibernate.dialect.CockroachDB192Dialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.SkipForDialect;
@ -67,7 +68,8 @@ public class CriteriaLiteralWithSingleQuoteTest extends BaseEntityManagerFunctio
value = {
@SkipForDialect(value = SQLServerDialect.class, comment = "SQLServer does not support literals in group by statement"),
@SkipForDialect(value = PostgreSQL81Dialect.class, comment = "PostgreSQL does not support literals in group by statement"),
@SkipForDialect( value = CockroachDB192Dialect.class, comment = "CockroachDB does not support literals in group by statement")
@SkipForDialect( value = CockroachDB192Dialect.class, comment = "CockroachDB does not support literals in group by statement"),
@SkipForDialect( value = SybaseASE15Dialect.class, comment = "Sybase does not support literals in group by statement")
}
)
public void testLiteralProjectionAndGroupBy() throws Exception {

View File

@ -38,6 +38,7 @@ import javax.persistence.criteria.Root;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.RequiresDialect;
@ -48,6 +49,7 @@ import org.junit.Test;
@TestForIssue( jiraKey = "HHH-9731" )
@SkipForDialect(value = DB2Dialect.class, comment = "We would need casts in the case clauses. See HHH-12822.")
@SkipForDialect(value = DerbyDialect.class, comment = "Derby requires either casted parameters or literals in the result arms of CASE expressions")
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Sybase requires either casted parameters or literals in the result arms of CASE expressions")
public class SelectCaseTest extends BaseEntityManagerFunctionalTestCase {
@Override

View File

@ -34,7 +34,7 @@ import static org.junit.Assert.fail;
/**
* @author Andrea Boriero
*/
@RequiresDialectFeature(DialectChecks.SupportsJdbcDriverProxying.class)
@RequiresDialectFeature({DialectChecks.SupportsJdbcDriverProxying.class, DialectChecks.SupportsLockTimeouts.class})
public class StatementIsClosedAfterALockExceptionTest extends BaseEntityManagerFunctionalTestCase {
private static final PreparedStatementSpyConnectionProvider CONNECTION_PROVIDER = new PreparedStatementSpyConnectionProvider( false, false );

View File

@ -31,6 +31,7 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.DerbyTenSevenDialect;
import org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess;
import org.hibernate.engine.jdbc.spi.JdbcServices;
@ -40,6 +41,8 @@ import org.hibernate.jpa.boot.spi.Bootstrap;
import org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.hibernate.testing.junit4.BaseUnitTestCase;
import org.junit.After;
import org.junit.Before;
@ -50,15 +53,20 @@ import static org.junit.Assert.assertEquals;
/**
* @author Steve Ebersole
*/
public class DateTimeParameterTest extends BaseUnitTestCase {
HibernateEntityManagerFactory entityManagerFactory;
@RequiresDialect(DerbyDialect.class)
public class DateTimeParameterTest extends BaseCoreFunctionalTestCase {
private static GregorianCalendar nowCal = new GregorianCalendar();
private static Date now = new Date( nowCal.getTime().getTime() );
@Override
protected Class<?>[] getAnnotatedClasses() {
return new Class[]{Message.class};
}
@Test
public void testBindingCalendarAsDate() {
EntityManager em = entityManagerFactory.createEntityManager();
EntityManager em = sessionFactory().createEntityManager();
em.getTransaction().begin();
try {
@ -76,7 +84,7 @@ public class DateTimeParameterTest extends BaseUnitTestCase {
@Test
public void testBindingCalendarAsTime() {
EntityManager em = entityManagerFactory.createEntityManager();
EntityManager em = sessionFactory().createEntityManager();
em.getTransaction().begin();
try {
@ -94,50 +102,19 @@ public class DateTimeParameterTest extends BaseUnitTestCase {
@Before
public void startUp() {
// create the EMF
entityManagerFactory = Bootstrap.getEntityManagerFactoryBuilder(
buildPersistenceUnitDescriptor(),
buildSettingsMap()
).build().unwrap( HibernateEntityManagerFactory.class );
// create the procedures
createTestData( entityManagerFactory );
createProcedures( entityManagerFactory );
}
private PersistenceUnitDescriptor buildPersistenceUnitDescriptor() {
return new BaseEntityManagerFunctionalTestCase.TestingPersistenceUnitDescriptorImpl( getClass().getSimpleName() );
}
@SuppressWarnings("unchecked")
private Map buildSettingsMap() {
Map settings = new HashMap();
settings.put( AvailableSettings.LOADED_CLASSES, Collections.singletonList( Message.class ) );
settings.put( org.hibernate.cfg.AvailableSettings.DIALECT, DerbyTenSevenDialect.class.getName() );
settings.put( org.hibernate.cfg.AvailableSettings.DRIVER, org.apache.derby.jdbc.EmbeddedDriver.class.getName() );
settings.put( org.hibernate.cfg.AvailableSettings.URL, "jdbc:derby:memory:hibernate-orm-testing;create=true" );
settings.put( org.hibernate.cfg.AvailableSettings.USER, "" );
settings.put( org.hibernate.cfg.AvailableSettings.HBM2DDL_AUTO, "create-drop" );
return settings;
createTestData( sessionFactory() );
createProcedures( sessionFactory() );
}
@After
public void tearDown() {
if ( entityManagerFactory == null ) {
return;
}
deleteTestData( entityManagerFactory );
dropProcedures( entityManagerFactory );
entityManagerFactory.close();
deleteTestData( sessionFactory() );
dropProcedures( sessionFactory() );
}
private void createProcedures(HibernateEntityManagerFactory emf) {
final SessionFactoryImplementor sf = emf.unwrap( SessionFactoryImplementor.class );
private void createProcedures(SessionFactoryImplementor sf) {
final JdbcConnectionAccess connectionAccess = sf.getServiceRegistry().getService( JdbcServices.class ).getBootstrapJdbcConnectionAccess();
final Connection conn;
try {
@ -248,7 +225,7 @@ public class DateTimeParameterTest extends BaseUnitTestCase {
out[0] = in;
}
private void createTestData(HibernateEntityManagerFactory entityManagerFactory) {
private void createTestData(SessionFactoryImplementor entityManagerFactory) {
EntityManager em = entityManagerFactory.createEntityManager();
em.getTransaction().begin();
em.persist( new Message( 1, "test", now, now, now ) );
@ -256,7 +233,7 @@ public class DateTimeParameterTest extends BaseUnitTestCase {
em.close();
}
private void deleteTestData(HibernateEntityManagerFactory entityManagerFactory) {
private void deleteTestData(SessionFactoryImplementor entityManagerFactory) {
EntityManager em = entityManagerFactory.createEntityManager();
em.getTransaction().begin();
em.createQuery( "delete from Message" ).executeUpdate();
@ -264,8 +241,7 @@ public class DateTimeParameterTest extends BaseUnitTestCase {
em.close();
}
private void dropProcedures(HibernateEntityManagerFactory emf) {
final SessionFactoryImplementor sf = emf.unwrap( SessionFactoryImplementor.class );
private void dropProcedures(SessionFactoryImplementor sf) {
final JdbcConnectionAccess connectionAccess = sf.getServiceRegistry().getService( JdbcServices.class ).getBootstrapJdbcConnectionAccess();
final Connection conn;
try {

View File

@ -20,6 +20,7 @@ import javax.persistence.EntityManager;
import javax.persistence.StoredProcedureQuery;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.DerbyTenSevenDialect;
import org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess;
import org.hibernate.engine.jdbc.spi.JdbcServices;
@ -30,6 +31,7 @@ import org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.junit4.BaseUnitTestCase;
import org.junit.After;
import org.junit.Before;
@ -46,11 +48,17 @@ import static org.junit.Assert.fail;
*
* @author Steve Ebersole
*/
public class JpaTckUsageTest extends BaseUnitTestCase {
@RequiresDialect(DerbyDialect.class)
public class JpaTckUsageTest extends BaseEntityManagerFunctionalTestCase {
@Override
protected Class<?>[] getAnnotatedClasses() {
return new Class[]{User.class};
}
@Test
public void testMultipleGetUpdateCountCalls() {
EntityManager em = entityManagerFactory.createEntityManager();
EntityManager em = entityManagerFactory().createEntityManager();
em.getTransaction().begin();
try {
@ -68,7 +76,7 @@ public class JpaTckUsageTest extends BaseUnitTestCase {
@Test
public void testBasicScalarResults() {
EntityManager em = entityManagerFactory.createEntityManager();
EntityManager em = entityManagerFactory().createEntityManager();
em.getTransaction().begin();
try {
@ -95,7 +103,7 @@ public class JpaTckUsageTest extends BaseUnitTestCase {
@Test
@FailureExpected( jiraKey = "HHH-8416", message = "JPA TCK challenge" )
public void testHasMoreResultsHandlingTckChallenge() {
EntityManager em = entityManagerFactory.createEntityManager();
EntityManager em = entityManagerFactory().createEntityManager();
em.getTransaction().begin();
try {
@ -113,7 +121,7 @@ public class JpaTckUsageTest extends BaseUnitTestCase {
@Test
public void testHasMoreResultsHandling() {
EntityManager em = entityManagerFactory.createEntityManager();
EntityManager em = entityManagerFactory().createEntityManager();
em.getTransaction().begin();
try {
@ -130,7 +138,7 @@ public class JpaTckUsageTest extends BaseUnitTestCase {
@Test
public void testResultClassHandling() {
EntityManager em = entityManagerFactory.createEntityManager();
EntityManager em = entityManagerFactory().createEntityManager();
em.getTransaction().begin();
try {
@ -157,7 +165,7 @@ public class JpaTckUsageTest extends BaseUnitTestCase {
@Test
public void testSettingInParamDefinedOnNamedStoredProcedureQuery() {
EntityManager em = entityManagerFactory.createEntityManager();
EntityManager em = entityManagerFactory().createEntityManager();
em.getTransaction().begin();
try {
StoredProcedureQuery query = em.createNamedStoredProcedureQuery( "positional-param" );
@ -171,7 +179,7 @@ public class JpaTckUsageTest extends BaseUnitTestCase {
@Test
public void testSettingNonExistingParams() {
EntityManager em = entityManagerFactory.createEntityManager();
EntityManager em = entityManagerFactory().createEntityManager();
em.getTransaction().begin();
try {
@ -204,7 +212,7 @@ public class JpaTckUsageTest extends BaseUnitTestCase {
@Test
@FailureExpected( jiraKey = "HHH-8395", message = "Out of the frying pan into the fire: https://issues.apache.org/jira/browse/DERBY-211" )
public void testExecuteUpdate() {
EntityManager em = entityManagerFactory.createEntityManager();
EntityManager em = entityManagerFactory().createEntityManager();
em.getTransaction().begin();
try {
@ -248,57 +256,21 @@ public class JpaTckUsageTest extends BaseUnitTestCase {
// "$$";
// public static final String deleteAllUsers_DROP_CMD = "DROP ALIAS deleteAllUsers IF EXISTS";
HibernateEntityManagerFactory entityManagerFactory;
@Before
public void startUp() {
// create the EMF
entityManagerFactory = Bootstrap.getEntityManagerFactoryBuilder(
buildPersistenceUnitDescriptor(),
buildSettingsMap()
).build().unwrap( HibernateEntityManagerFactory.class );
// create the procedures
createTestUser( entityManagerFactory );
createProcedures( entityManagerFactory );
}
private PersistenceUnitDescriptor buildPersistenceUnitDescriptor() {
return new BaseEntityManagerFunctionalTestCase.TestingPersistenceUnitDescriptorImpl( getClass().getSimpleName() );
}
@SuppressWarnings("unchecked")
private Map buildSettingsMap() {
Map settings = new HashMap();
settings.put( AvailableSettings.LOADED_CLASSES, Collections.singletonList( User.class ) );
settings.put( org.hibernate.cfg.AvailableSettings.DIALECT, DerbyTenSevenDialect.class );
settings.put( org.hibernate.cfg.AvailableSettings.DRIVER, org.apache.derby.jdbc.EmbeddedDriver.class.getName() );
// settings.put( org.hibernate.cfg.AvailableSettings.URL, "jdbc:derby:/tmp/hibernate-orm-testing;create=true" );
settings.put( org.hibernate.cfg.AvailableSettings.URL, "jdbc:derby:memory:hibernate-orm-testing;create=true" );
settings.put( org.hibernate.cfg.AvailableSettings.USER, "" );
settings.put( org.hibernate.cfg.AvailableSettings.HBM2DDL_AUTO, "create-drop" );
settings.put( org.hibernate.cfg.AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true" );
settings.put( org.hibernate.cfg.AvailableSettings.DIALECT, DerbyTenSevenDialect.class.getName() );
return settings;
createTestUser( entityManagerFactory() );
createProcedures( entityManagerFactory() );
}
@After
public void tearDown() {
if ( entityManagerFactory == null ) {
return;
}
deleteTestUser( entityManagerFactory );
dropProcedures( entityManagerFactory );
entityManagerFactory.close();
deleteTestUser( entityManagerFactory() );
dropProcedures( entityManagerFactory() );
}
private void createProcedures(HibernateEntityManagerFactory emf) {
final SessionFactoryImplementor sf = emf.unwrap( SessionFactoryImplementor.class );
private void createProcedures(SessionFactoryImplementor sf) {
final JdbcConnectionAccess connectionAccess = sf.getServiceRegistry().getService( JdbcServices.class ).getBootstrapJdbcConnectionAccess();
final Connection conn;
try {
@ -395,7 +367,7 @@ public class JpaTckUsageTest extends BaseUnitTestCase {
conn.close();
}
private void createTestUser(HibernateEntityManagerFactory entityManagerFactory) {
private void createTestUser(SessionFactoryImplementor entityManagerFactory) {
EntityManager em = entityManagerFactory.createEntityManager();
em.getTransaction().begin();
@ -404,7 +376,7 @@ public class JpaTckUsageTest extends BaseUnitTestCase {
em.close();
}
private void deleteTestUser(HibernateEntityManagerFactory entityManagerFactory) {
private void deleteTestUser(SessionFactoryImplementor entityManagerFactory) {
EntityManager em = entityManagerFactory.createEntityManager();
em.getTransaction().begin();
em.createQuery( "delete from User" ).executeUpdate();
@ -412,8 +384,7 @@ public class JpaTckUsageTest extends BaseUnitTestCase {
em.close();
}
private void dropProcedures(HibernateEntityManagerFactory emf) {
final SessionFactoryImplementor sf = emf.unwrap( SessionFactoryImplementor.class );
private void dropProcedures(SessionFactoryImplementor sf) {
final JdbcConnectionAccess connectionAccess = sf.getServiceRegistry().getService( JdbcServices.class ).getBootstrapJdbcConnectionAccess();
final Connection conn;
try {

View File

@ -30,7 +30,6 @@ import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.dialect.PostgreSQL9Dialect;
import org.hibernate.dialect.PostgresPlusDialect;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.jpa.test.Distributor;
@ -136,7 +135,6 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
}
@Test
@SkipForDialect(value = SybaseDialect.class, comment = "Null == null on Sybase")
@SkipForDialect(value = DerbyDialect.class, comment = "Cannot convert untyped null (assumed to be VARBINARY type) to VARCHAR")
public void testNullPositionalParameter() throws Exception {
EntityManager em = getOrCreateEntityManager();
@ -167,7 +165,6 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
}
@Test
@SkipForDialect(value = SybaseDialect.class, comment = "Null == null on Sybase")
@SkipForDialect(value = DerbyDialect.class, comment = "Cannot convert untyped null (assumed to be VARBINARY type) to VARCHAR")
public void testNullPositionalParameterParameter() throws Exception {
EntityManager em = getOrCreateEntityManager();
@ -215,7 +212,6 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
}
@Test
@SkipForDialect(value = SybaseDialect.class, comment = "Null == null on Sybase")
@SkipForDialect(value = DerbyDialect.class, comment = "Cannot convert untyped null (assumed to be VARBINARY type) to VARCHAR")
public void testNullPositionalParameterParameterIncompatible() throws Exception {
EntityManager em = getOrCreateEntityManager();
@ -263,7 +259,6 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
}
@Test
@SkipForDialect(value = SybaseDialect.class, comment = "Null == null on Sybase")
@SkipForDialect(value = DerbyDialect.class, comment = "Cannot convert untyped null (assumed to be VARBINARY type) to VARCHAR")
public void testNullNamedParameter() throws Exception {
EntityManager em = getOrCreateEntityManager();
@ -294,7 +289,6 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
}
@Test
@SkipForDialect(value = SybaseDialect.class, comment = "Null == null on Sybase")
@SkipForDialect(value = DerbyDialect.class, comment = "Cannot convert untyped null (assumed to be VARBINARY type) to VARCHAR")
public void testNullNamedParameterParameter() throws Exception {
EntityManager em = getOrCreateEntityManager();
@ -341,7 +335,6 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
}
@Test
@SkipForDialect(value = SybaseDialect.class, comment = "Null == null on Sybase")
@SkipForDialect(value = DerbyDialect.class, comment = "Cannot convert untyped null (assumed to be VARBINARY type) to VARCHAR")
public void testNullNamedParameterParameterIncompatible() throws Exception {
EntityManager em = getOrCreateEntityManager();
@ -392,7 +385,6 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
@SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = CockroachDB192Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = SybaseDialect.class, comment = "Null == null on Sybase")
@SkipForDialect(value = DerbyDialect.class, comment = "Cannot convert untyped null (assumed to be VARBINARY type) to INTEGER")
public void testNativeQueryNullPositionalParameter() throws Exception {
EntityManager em = getOrCreateEntityManager();
@ -430,7 +422,6 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
@SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = CockroachDB192Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = Oracle8iDialect.class, comment = "ORA-00932: inconsistent datatypes: expected NUMBER got BINARY")
@SkipForDialect(value = SybaseDialect.class, comment = "Null == null on Sybase")
@SkipForDialect(value = DerbyDialect.class, comment = "Cannot convert untyped null (assumed to be VARBINARY type) to INTEGER")
public void testNativeQueryNullPositionalParameterParameter() throws Exception {
EntityManager em = getOrCreateEntityManager();
@ -484,7 +475,6 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
@SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = CockroachDB192Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = SybaseDialect.class, comment = "Null == null on Sybase")
@SkipForDialect(value = DerbyDialect.class, comment = "Cannot convert untyped null (assumed to be VARBINARY type) to INTEGER")
public void testNativeQueryNullNamedParameter() throws Exception {
EntityManager em = getOrCreateEntityManager();
@ -522,7 +512,6 @@ public class QueryTest extends BaseEntityManagerFunctionalTestCase {
@SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = CockroachDB192Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = Oracle8iDialect.class, comment = "ORA-00932: inconsistent datatypes: expected NUMBER got BINARY")
@SkipForDialect(value = SybaseDialect.class, comment = "Null == null on Sybase")
@SkipForDialect(value = DerbyDialect.class, comment = "Cannot convert untyped null (assumed to be VARBINARY type) to INTEGER")
public void testNativeQueryNullNamedParameterParameter() throws Exception {
EntityManager em = getOrCreateEntityManager();

View File

@ -373,6 +373,7 @@ public class PersistenceUnitOverridesTests extends BaseUnitTestCase {
integrationSettings.put( AvailableSettings.JPA_JDBC_URL, ConnectionProviderBuilder.URL );
integrationSettings.put( AvailableSettings.JPA_JDBC_USER, ConnectionProviderBuilder.USER );
integrationSettings.put( AvailableSettings.JPA_JDBC_PASSWORD, ConnectionProviderBuilder.PASS );
integrationSettings.put( "hibernate.connection.init_sql", "" );
final PersistenceProvider provider = new HibernatePersistenceProvider();

View File

@ -8,9 +8,11 @@ import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.query.criteria.HibernateCriteriaBuilder;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.junit.Assert;
import org.junit.Test;
@ -29,6 +31,7 @@ public class NullPrecedenceTest extends BaseEntityManagerFunctionalTestCase {
}
@Test
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "No support for null precedence on Sybase")
public void testNullPrecedence() {
doInJPA( this::entityManagerFactory, entityManager -> {
entityManager.persist( new Foo( 1L, null ) );

View File

@ -22,6 +22,7 @@ import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.SkipForDialect;
@ -67,6 +68,7 @@ public class SearchedCaseExpressionTest extends BaseCoreFunctionalTestCase {
@Test
@SkipForDialect(value = DB2Dialect.class, comment = "We would need casts in the case clauses. See HHH-12822.")
@SkipForDialect(value = DerbyDialect.class, comment = "Derby requires either casted parameters or literals in the result arms of CASE expressions")
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Sybase requires either casted parameters or literals in the result arms of CASE expressions")
public void testEqualClause() {
doInHibernate( this::sessionFactory, session -> {
CriteriaBuilder cb = session.getCriteriaBuilder();
@ -93,6 +95,7 @@ public class SearchedCaseExpressionTest extends BaseCoreFunctionalTestCase {
@TestForIssue(jiraKey = "HHH-13167")
@SkipForDialect(value = DB2Dialect.class, comment = "We would need casts in the case clauses. See HHH-12822.")
@SkipForDialect(value = DerbyDialect.class, comment = "Derby requires either casted parameters or literals in the result arms of CASE expressions")
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Sybase requires either casted parameters or literals in the result arms of CASE expressions")
public void testMissingElseClause() {
doInHibernate( this::sessionFactory, session -> {
Event event = new Event();

View File

@ -9,6 +9,7 @@ import javax.persistence.Table;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
@ -30,6 +31,7 @@ public class HHH14156Test extends BaseCoreFunctionalTestCase {
@Test
@SkipForDialect(value = SQLServerDialect.class, comment = "SQLServer doesn't support tuple comparisons")
@SkipForDialect(value = DerbyDialect.class, comment = "Derby doesn't support tuple comparisons")
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Sybase doesn't support tuple comparisons")
public void testNoExceptionThrown() {
inTransaction( session ->
session.createQuery(

View File

@ -18,11 +18,13 @@ import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.Generated;
import org.hibernate.annotations.NaturalId;
import org.hibernate.annotations.ValueGenerationType;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.tuple.AnnotationValueGeneration;
import org.hibernate.tuple.GenerationTiming;
import org.hibernate.tuple.ValueGenerator;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.junit.Assert;
import org.junit.Test;
@ -33,6 +35,7 @@ import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
* @author Vlad Mihalcea
*/
@TestForIssue( jiraKey = "HHH-11096" )
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "current_timestamp requires parenthesis which we don't render")
public class DatabaseCreationTimestampNullableColumnTest extends BaseEntityManagerFunctionalTestCase {
@Override

View File

@ -158,7 +158,6 @@ public class EmbeddedTest extends BaseNonConfigCoreFunctionalTestCase {
@Test
@TestForIssue(jiraKey = "HHH-8172")
@SkipForDialect( value = SybaseDialect.class, comment = "skip for Sybase because (null = null) evaluates to true")
@FailureExpected(jiraKey = "HHH-8172")
public void testQueryWithEmbeddedParameterOneNull() throws Exception {
Person person = new Person();

View File

@ -19,9 +19,11 @@ import org.hibernate.Transaction;
import org.hibernate.boot.MetadataBuilder;
import org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl;
import org.hibernate.criterion.Restrictions;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.exception.ConstraintViolationException;
import org.hibernate.mapping.Join;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
import org.junit.Test;
@ -152,6 +154,7 @@ public class JoinTest extends BaseNonConfigCoreFunctionalTestCase {
}
@Test
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Missing constraint violation extractor")
public void testUniqueConstaintOnSecondaryTable() throws Exception {
Cat cat = new Cat();
cat.setStoryPart2( "My long story" );

View File

@ -9,13 +9,17 @@
package org.hibernate.test.annotations.lob;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
/**
* @author Emmanuel Bernard
*/
@RequiresDialectFeature(DialectChecks.SupportsExpectedLobUsagePattern.class)
@SkipForDialect( value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement binary stream handling")
public class LobTest extends AbstractLobTest<Book, CompiledCode> {
@Override
protected Class<Book> getBookClass() {

View File

@ -10,9 +10,12 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import static org.junit.Assert.assertEquals;
@ -22,6 +25,7 @@ import static org.junit.Assert.assertNotNull;
* @author Gail Badner
*/
@RequiresDialectFeature(DialectChecks.SupportsExpectedLobUsagePattern.class)
@SkipForDialect( value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement binary stream handling")
public class VersionedLobTest extends AbstractLobTest<VersionedBook, VersionedCompiledCode> {
@Override
protected Class<VersionedBook> getBookClass() {

View File

@ -14,8 +14,11 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.type.descriptor.java.DataHelper;
/**
@ -35,6 +38,7 @@ public class LobLocatorTest extends BaseCoreFunctionalTestCase {
@Test
@TestForIssue(jiraKey = "HHH-8193")
@RequiresDialectFeature(DialectChecks.UsesInputStreamToInsertBlob.class)
@SkipForDialect( value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement binary stream handling")
public void testStreamResetBeforeParameterBinding() throws SQLException {
final Session session = openSession();

View File

@ -32,6 +32,7 @@ import org.hibernate.annotations.OnDeleteAction;
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.exception.ConstraintViolationException;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.PersistentClass;
@ -39,6 +40,7 @@ import org.hibernate.mapping.Table;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
import org.hibernate.test.annotations.Customer;
@ -138,6 +140,7 @@ public class OneToManyTest extends BaseNonConfigCoreFunctionalTestCase {
}
@Test
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Missing constraint violation extractor")
public void testUnidirectionalDefault() throws Exception {
Session s;
Transaction tx;

View File

@ -30,6 +30,7 @@ import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.dialect.SQLServer2008Dialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.graph.RootGraph;
import org.hibernate.persister.collection.CollectionPersister;
@ -37,6 +38,7 @@ import org.hibernate.persister.collection.QueryableCollection;
import org.hibernate.query.Query;
import org.hibernate.sql.SimpleSelect;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Assert;
@ -49,6 +51,7 @@ import org.junit.Test;
*/
public class OrderByTest extends BaseCoreFunctionalTestCase {
@Test
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Didn't check what's wrong, but probably null ordering")
public void testOrderByOnIdClassProperties() throws Exception {
Session s = openSession( );
s.getTransaction().begin();
@ -419,6 +422,7 @@ public class OrderByTest extends BaseCoreFunctionalTestCase {
@Test
@TestForIssue(jiraKey = "HHH-8794")
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Didn't check what's wrong, but probably null ordering")
public void testOrderByNoElement() {
final Session s = openSession();
@ -451,6 +455,7 @@ public class OrderByTest extends BaseCoreFunctionalTestCase {
@Test
@TestForIssue( jiraKey = "HHH-9002" )
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Didn't check what's wrong, but probably null ordering")
public void testOrderByOneToManyWithJoinTable() {
A a = new A();
a.setName( "a" );

View File

@ -10,11 +10,13 @@ import javax.persistence.PersistenceException;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.exception.ConstraintViolationException;
import org.hibernate.id.IdentifierGenerationException;
import org.junit.Test;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -25,6 +27,7 @@ import static org.junit.Assert.fail;
public class OneToOneJoinTableTest extends BaseCoreFunctionalTestCase {
@Test
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Missing constraint violation extractor")
public void storeNonUniqueRelationship() throws Throwable {
Session session = null;
try {

View File

@ -30,10 +30,10 @@ import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.PostgreSQL9Dialect;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.PostgresPlusDialect;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.dialect.function.SQLFunction;
import org.hibernate.stat.Statistics;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -121,7 +121,6 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
@SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = CockroachDB192Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = SybaseDialect.class, comment = "Null == null on Sybase")
@SkipForDialect(value = DerbyDialect.class, comment = "Cannot convert untyped null (assumed to be VARBINARY type) to BIGINT")
public void testQueryWithNullParameter(){
Chaos c0 = new Chaos();
@ -163,7 +162,6 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
@Test
@TestForIssue( jiraKey = "HHH-10161")
@SkipForDialect(value = SybaseDialect.class, comment = "Null == null on Sybase")
public void testQueryWithNullParameterTyped(){
Chaos c0 = new Chaos();
c0.setId( 0L );
@ -208,7 +206,6 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
@SkipForDialect(value = PostgreSQL9Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = PostgresPlusDialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = CockroachDB192Dialect.class, jiraKey = "HHH-10312", comment = "Cannot convert untyped null (assumed to be bytea type) to bigint")
@SkipForDialect(value = SybaseDialect.class, comment = "Null == null on Sybase")
@SkipForDialect(value = DerbyDialect.class, comment = "Cannot convert untyped null (assumed to be VARBINARY type) to BIGINT")
public void testNativeQueryWithNullParameter(){
Chaos c0 = new Chaos();
@ -250,7 +247,6 @@ public class QueryAndSQLTest extends BaseCoreFunctionalTestCase {
@Test
@TestForIssue( jiraKey = "HHH-10161")
@SkipForDialect(value = SybaseDialect.class, comment = "Null == null on Sybase")
public void testNativeQueryWithNullParameterTyped(){
Chaos c0 = new Chaos();
c0.setId( 0L );

View File

@ -17,8 +17,10 @@ import javax.persistence.Table;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.exception.ConstraintViolationException;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test;
@ -39,6 +41,7 @@ public class UniqueConstraintThrowsConstraintViolationExceptionTest extends Base
}
@Test
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Missing constraint violation extractor")
public void testUniqueConstraintWithEmptyColumnName() {
doInHibernate( this::sessionFactory, session -> {
Customer customer1 = new Customer();

View File

@ -57,6 +57,7 @@ import org.hibernate.dialect.MariaDB10Dialect;
import org.hibernate.dialect.MariaDB53Dialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.SQLServer2012Dialect;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.engine.config.spi.ConfigurationService;
import org.hibernate.engine.jdbc.env.spi.NameQualifierSupport;
import org.hibernate.engine.spi.SessionFactoryImplementor;
@ -86,6 +87,7 @@ import org.junit.runners.Parameterized;
@RunWith(CustomParameterized.class)
@TestForIssue(jiraKey = { "HHH-14921", "HHH-14922" })
@SkipForDialect(value = SybaseDialect.class, comment = "Sybase doesn't support sequences")
@SkipForDialect(value = MySQLDialect.class, comment = "MySQL doesn't support sequences")
@SkipForDialect(value = MariaDB53Dialect.class, strictMatching = true,
comment = "MariaDB < 10.3 doesn't support sequences")

View File

@ -8,7 +8,10 @@ package org.hibernate.test.bytecode.enhancement.lazy;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.bytecode.enhancement.BytecodeEnhancerRunner;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -38,6 +41,7 @@ import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
@TestForIssue( jiraKey = "HHH-10747" )
@RunWith( BytecodeEnhancerRunner.class )
@SkipForDialect( value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement binary stream handling")
public class LazyLoadingByEnhancerSetterTest extends BaseCoreFunctionalTestCase {
private Item item, mergedItem;

View File

@ -10,7 +10,9 @@ import java.util.Map;
import org.hibernate.Session;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
import org.junit.Test;
@ -25,6 +27,7 @@ public class ConverterAndLobTest extends BaseNonConfigCoreFunctionalTestCase {
@Test
@TestForIssue( jiraKey = "HHH-9615" )
@SkipForDialect( value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement binary stream handling")
@SuppressWarnings("unchecked")
public void basicTest() {

View File

@ -17,6 +17,7 @@ import org.hibernate.criterion.Restrictions;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
@ -33,6 +34,7 @@ import static org.junit.Assert.assertEquals;
@SkipForDialect(value = DB2Dialect.class, comment = "DB2 jdbc driver doesn't support setNString")
@SkipForDialect(value = DerbyDialect.class, comment = "Derby jdbc driver doesn't support setNString")
@SkipForDialect(value = PostgreSQL81Dialect.class, comment = "PostgreSQL jdbc driver doesn't support setNString")
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "jTDS jdbc driver doesn't support setNString")
public class NationalizedIgnoreCaseTest extends BaseCoreFunctionalTestCase {
@Override

View File

@ -16,6 +16,7 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.dialect.AbstractHANADialect;
import org.hibernate.dialect.MySQLMyISAMDialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.engine.jdbc.spi.JdbcCoordinator;
import org.hibernate.engine.jdbc.spi.ResultSetReturn;
import org.hibernate.engine.jdbc.spi.StatementPreparer;
@ -44,6 +45,7 @@ public class SQLExceptionConversionTest extends BaseCoreFunctionalTestCase {
value = { MySQLMyISAMDialect.class, AbstractHANADialect.class },
comment = "MySQL (MyISAM) / Hana do not support FK violation checking"
)
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Missing constraint violation extractor")
public void testIntegrityViolation() throws Exception {
final Session session = openSession();
session.beginTransaction();
@ -110,6 +112,7 @@ public class SQLExceptionConversionTest extends BaseCoreFunctionalTestCase {
@Test
@TestForIssue(jiraKey = "HHH-7357")
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Missing constraint violation extractor")
public void testNotNullConstraint() {
final Session session = openSession();
session.beginTransaction();

View File

@ -21,7 +21,9 @@ import javax.persistence.MappedSuperclass;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
import org.junit.Test;
@ -44,6 +46,7 @@ public class InheritanceManyToManyForeignKeyTest extends BaseNonConfigCoreFuncti
}
@Test
@SkipForDialect(value = SybaseDialect.class, comment = "Only dates between January 1, 1753 and December 31, 9999 are accepted.")
public void testForeignKeyNameUnicity() {
Session session = openSession();
Transaction transaction = session.beginTransaction();

View File

@ -18,7 +18,7 @@
</id>
<property name="name"/>
<property name="lastModified" generated="always" type="binary">
<column name="lastModified" length="8" sql-type="TIMESTAMP"/>
<column name="lastModified" length="8" sql-type="timestamp"/>
</property>
</class>

View File

@ -96,6 +96,7 @@ public class IndicesTest extends BaseNonConfigCoreFunctionalTestCase {
}
@Entity(name = "Role")
@Table(name = "proj_role")
public static class Role {
@Id

View File

@ -12,6 +12,7 @@ import java.util.List;
import org.hibernate.dialect.AbstractHANADialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.query.spi.QueryImplementor;
import org.hibernate.testing.SkipForDialect;
@ -91,6 +92,7 @@ public class WhereAnnotatedOneToManySizeTest extends BaseCoreFunctionalTestCase
@Test
@SkipForDialect(value = DB2Dialect.class, comment = "DB2 does not support correlated subqueries in the ORDER BY clause")
@SkipForDialect(value = AbstractHANADialect.class, comment = "HANA db does not support correlated subqueries in the ORDER BY clause")
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Sybase does not support correlated subqueries in the ORDER BY clause")
public void orderBy_sizeOf() {
inSession( session -> {
QueryImplementor<Object[]> query = session.createQuery(
@ -104,6 +106,7 @@ public class WhereAnnotatedOneToManySizeTest extends BaseCoreFunctionalTestCase
@Test
@SkipForDialect(value = DB2Dialect.class, comment = "DB2 does not support correlated subqueries in the ORDER BY clause")
@SkipForDialect(value = AbstractHANADialect.class, comment = "HANA db does not support correlated subqueries in the ORDER BY clause")
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Sybase does not support correlated subqueries in the ORDER BY clause")
public void orderBy_dotSize() {
inSession( session -> {
QueryImplementor<Object[]> query = session.createQuery(

View File

@ -9,6 +9,7 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
@ -64,8 +65,9 @@ public class Oracle12LimitTest extends BaseCoreFunctionalTestCase {
);
}
@Entity
public class Person {
@Entity(name = "Person")
@Table(name = "Person")
public static class Person {
@Id
private Long id;
@ -76,8 +78,9 @@ public class Oracle12LimitTest extends BaseCoreFunctionalTestCase {
private String name;
}
@Entity
public class UserFunctionalArea {
@Entity(name = "UserFunctionalArea")
@Table(name = "UserFunctionalArea")
public static class UserFunctionalArea {
@Id
@Column(name = "USER_KEY")
private Integer id;

View File

@ -12,6 +12,7 @@ import java.util.Arrays;
import org.hibernate.Hibernate;
import org.hibernate.LockOptions;
import org.hibernate.Session;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.dialect.TeradataDialect;
import org.hibernate.testing.DialectChecks;
@ -45,6 +46,7 @@ public class BlobLocatorTest extends BaseCoreFunctionalTestCase {
jiraKey = "HHH-6637",
comment = "Teradata requires locator to be used in same session where it was created/retrieved"
)
@SkipForDialect( value = SybaseASE15Dialect.class, comment = "Sybase doesn't support empty blobs")
public void testBoundedBlobLocatorAccess() throws Throwable {
byte[] original = buildByteArray( BLOB_SIZE, true );
byte[] changed = buildByteArray( BLOB_SIZE, false );

View File

@ -11,6 +11,7 @@ import java.sql.Clob;
import org.hibernate.LockOptions;
import org.hibernate.Session;
import org.hibernate.dialect.SybaseASE157Dialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.dialect.TeradataDialect;
import org.hibernate.type.descriptor.java.DataHelper;
@ -47,6 +48,7 @@ public class ClobLocatorTest extends BaseCoreFunctionalTestCase {
jiraKey = "HHH-6637",
comment = "Teradata requires locator to be used in same session where it was created/retrieved"
)
@SkipForDialect( value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement character stream handling")
public void testBoundedClobLocatorAccess() throws Throwable {
String original = buildString( CLOB_SIZE, 'x' );
String changed = buildString( CLOB_SIZE, 'y' );
@ -131,6 +133,7 @@ public class ClobLocatorTest extends BaseCoreFunctionalTestCase {
value = DialectChecks.SupportsUnboundedLobLocatorMaterializationCheck.class,
comment = "database/driver does not support materializing a LOB locator outside the owning transaction"
)
@SkipForDialect( value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement character stream handling")
public void testUnboundedClobLocatorAccess() throws Throwable {
// Note: unbounded mutation of the underlying lob data is completely
// unsupported; most databases would not allow such a construct anyway.

View File

@ -9,7 +9,9 @@ package org.hibernate.test.lob;
import java.util.Arrays;
import org.hibernate.Session;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Assert;
import org.junit.Test;
@ -26,6 +28,7 @@ public abstract class LongByteArrayTest extends BaseCoreFunctionalTestCase {
private static final int ARRAY_SIZE = 10000;
@Test
@SkipForDialect( value = SybaseASE15Dialect.class, comment = "Sybase doesn't support empty blobs")
public void testBoundedLongByteArrayAccess() {
byte[] original = buildRecursively( ARRAY_SIZE, true );
byte[] changed = buildRecursively( ARRAY_SIZE, false );

View File

@ -6,8 +6,11 @@
*/
package org.hibernate.test.lob;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
/**
* Tests eager materialization and mutation of data mapped by
@ -16,6 +19,7 @@ import org.hibernate.testing.RequiresDialectFeature;
* @author Gail Badner
*/
@RequiresDialectFeature( DialectChecks.SupportsExpectedLobUsagePattern.class )
@SkipForDialect( value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement character stream handling")
public class MaterializedClobTest extends LongStringTest {
public String[] getMappings() {
return new String[] { "lob/MaterializedClobMappings.hbm.xml" };

View File

@ -13,7 +13,9 @@ import org.hibernate.LockMode;
import org.hibernate.Query;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.After;
@ -28,6 +30,7 @@ import static org.junit.Assert.assertEquals;
* @author Steve Ebersole
*/
@TestForIssue( jiraKey = "HHH-1168" )
@SkipForDialect( value = SybaseASE15Dialect.class, comment = "Didn't dig into it too deeply, but I think it requires follow on locking")
public class PagingAndLockingTest extends BaseCoreFunctionalTestCase {
@Override
protected Class<?>[] getAnnotatedClasses() {

View File

@ -10,8 +10,10 @@ import javax.persistence.PersistenceException;
import java.util.HashSet;
import org.hibernate.Session;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.exception.ConstraintViolationException;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.test.manytomanyassociationclass.AbstractManyToManyAssociationClassTest;
import org.hibernate.test.manytomanyassociationclass.Membership;
import org.junit.Test;
@ -24,6 +26,7 @@ import static org.junit.Assert.fail;
*
* @author Gail Badner
*/
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Missing constraint violation extractor")
public class ManyToManyAssociationClassGeneratedIdTest extends AbstractManyToManyAssociationClassTest {
@Override
public String[] getMappings() {

View File

@ -34,13 +34,6 @@ private ServiceRegistry serviceRegistry;
@Before
public void setup(){
cfg=new Configuration();
Properties p = new Properties();
p.put( Environment.DIALECT, "org.hibernate.dialect.HSQLDialect" );
p.put( "hibernate.connection.driver_class", "org.h2.Driver" );
p.put( "hibernate.connection.url", "jdbc:h2:mem:" );
p.put( "hibernate.connection.username", "sa" );
p.put( "hibernate.connection.password", "" );
cfg.setProperties(p);
serviceRegistry = ServiceRegistryBuilder.buildServiceRegistry( cfg.getProperties() );
}

View File

@ -14,6 +14,7 @@ import org.hibernate.PersistentObjectException;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.dialect.AbstractHANADialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.exception.ConstraintViolationException;
import org.hibernate.testing.DialectChecks;
@ -120,6 +121,7 @@ public class CreateTest extends AbstractOperationTestCase {
}
@Test
@SkipForDialect(value = SybaseASE15Dialect.class, comment = "Missing constraint violation extractor")
public void testCreateException() {
Session s = openSession();
Transaction tx = s.beginTransaction();

View File

@ -22,14 +22,17 @@ import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.boot.spi.MetadataImplementor;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.hibernate.tool.hbm2ddl.SchemaUpdate;
import org.hibernate.tool.hbm2ddl.SchemaValidator;
import org.hibernate.tool.schema.JdbcMetadaAccessStrategy;
import org.hibernate.tool.schema.TargetType;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -81,6 +84,10 @@ public class SchemaUpdateWithUseJdbcMetadataDefaultsSettingToFalseAndQuotedNameT
@After
public void tearDown() {
// The jTDS driver doesn't support schemas
if ( metadata.getDatabase().getDialect() instanceof SybaseASE15Dialect ) {
return;
}
new SchemaExport().setHaltOnError( true )
.setFormat( false )
.drop( EnumSet.of( TargetType.DATABASE ), metadata );
@ -88,8 +95,13 @@ public class SchemaUpdateWithUseJdbcMetadataDefaultsSettingToFalseAndQuotedNameT
}
@Test
// @SkipForDialect(value = SybaseASE15Dialect.class, comment = "The jTDS driver doesn't support schemas")
public void testSchemaUpdateDoesNotTryToRecreateExistingTables()
throws Exception {
// The jTDS driver doesn't support schemas
if ( metadata.getDatabase().getDialect() instanceof SybaseASE15Dialect ) {
return;
}
createSchema();
new SchemaUpdate().setHaltOnError( true )

View File

@ -21,14 +21,17 @@ import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.boot.spi.MetadataImplementor;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.hibernate.tool.hbm2ddl.SchemaUpdate;
import org.hibernate.tool.hbm2ddl.SchemaValidator;
import org.hibernate.tool.schema.JdbcMetadaAccessStrategy;
import org.hibernate.tool.schema.TargetType;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -84,6 +87,10 @@ public class SchemaUpdateWithUseJdbcMetadataDefaultsSettingToFalseTest {
@After
public void tearDown() {
// The jTDS driver doesn't support schemas
if ( metadata.getDatabase().getDialect() instanceof SybaseASE15Dialect ) {
return;
}
new SchemaExport().setHaltOnError( true )
.setFormat( false )
.drop( EnumSet.of( TargetType.DATABASE ), metadata );
@ -91,8 +98,13 @@ public class SchemaUpdateWithUseJdbcMetadataDefaultsSettingToFalseTest {
}
@Test
// @SkipForDialect(value = SybaseASE15Dialect.class, comment = "The jTDS driver doesn't support schemas")
public void testSchemaUpdateDoesNotTryToRecreateExistingTables()
throws Exception {
// The jTDS driver doesn't support schemas
if ( metadata.getDatabase().getDialect() instanceof SybaseASE15Dialect ) {
return;
}
createSchema();
new SchemaUpdate().setHaltOnError( true )

View File

@ -70,11 +70,11 @@
<sql-delete>DELETE FROM EMPLOYMENT WHERE EMPID=?</sql-delete>
</class>
<class name="TextHolder">
<id name="id" column="id">
<class name="TextHolder" table="TEXTHOLDER">
<id name="id" column="ID">
<generator class="increment"/>
</id>
<property name="description" type="text" length="15000"/>
<property name="description" column="DESCRIPTION" type="text" length="15000"/>
<loader query-ref="textholder"/>
<sql-insert>
INSERT INTO TEXTHOLDER
@ -85,11 +85,11 @@
<sql-delete>DELETE FROM TEXTHOLDER WHERE ID=?</sql-delete>
</class>
<class name="ImageHolder">
<id name="id" column="id">
<class name="ImageHolder" table="IMAGEHOLDER">
<id name="id" column="ID">
<generator class="increment"/>
</id>
<property name="photo" type="image" length="15000"/>
<property name="photo" column="PHOTO" type="image" length="15000"/>
<loader query-ref="imageholder"/>
<sql-insert>
INSERT INTO IMAGEHOLDER

View File

@ -12,6 +12,7 @@ import org.hibernate.dialect.SybaseAnywhereDialect;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.test.sql.hand.custom.CustomStoredProcTestSupport;
import org.hibernate.testing.RequiresDialect;
import org.junit.Ignore;
/**
* Custom SQL tests for Sybase dialects
@ -19,6 +20,7 @@ import org.hibernate.testing.RequiresDialect;
* @author Gavin King
*/
@RequiresDialect( { SybaseDialect.class, SybaseASE15Dialect.class, Sybase11Dialect.class, SybaseAnywhereDialect.class })
@Ignore("The jTDS driver doesn't detect callable prepared statements and can't unwrap from a PreparedStatement to a CallableStatement")
public class SybaseCustomSQLTest extends CustomStoredProcTestSupport {
public String[] getMappings() {
return new String[] { "sql/hand/custom/sybase/Mappings.hbm.xml" };

View File

@ -10,6 +10,9 @@ import javax.persistence.PersistenceException;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
@ -846,8 +849,21 @@ public class NativeSQLQueriesTest extends BaseCoreFunctionalTestCase {
s = openSession();
t = s.beginTransaction();
String descriptionRead = ( String ) s.createSQLQuery( getDescriptionsSQL() )
Object result = s.createSQLQuery( getDescriptionsSQL() )
.uniqueResult();
String descriptionRead;
if ( result instanceof String ) {
descriptionRead = (String) result;
}
else {
Clob clob = (Clob) result;
try {
descriptionRead = clob.getSubString( 1L, (int) clob.length() );
}
catch (SQLException e) {
throw new RuntimeException( e );
}
}
assertEquals( description, descriptionRead );
s.delete( holder );
t.commit();
@ -859,7 +875,8 @@ public class NativeSQLQueriesTest extends BaseCoreFunctionalTestCase {
public void testImageTypeInSQLQuery() {
Session s = openSession();
Transaction t = s.beginTransaction();
byte[] photo = buildLongByteArray( 15000, true );
// Make sure the last byte is non-zero as Sybase cuts that off
byte[] photo = buildLongByteArray( 14999, true );
ImageHolder holder = new ImageHolder( photo );
s.persist( holder );
t.commit();
@ -867,8 +884,21 @@ public class NativeSQLQueriesTest extends BaseCoreFunctionalTestCase {
s = openSession();
t = s.beginTransaction();
byte[] photoRead = ( byte[] ) s.createSQLQuery( getPhotosSQL() )
Object result = s.createSQLQuery( getPhotosSQL() )
.uniqueResult();
byte[] photoRead;
if ( result instanceof byte[] ) {
photoRead = (byte[]) result;
}
else {
Blob blob = (Blob) result;
try {
photoRead = blob.getBytes( 1L, (int) blob.length() );
}
catch (SQLException e) {
throw new RuntimeException( e );
}
}
assertTrue( Arrays.equals( photo, photoRead ) );
s.delete( holder );
t.commit();

View File

@ -25,6 +25,7 @@ import javax.persistence.Id;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.MariaDBDialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.dialect.SybaseDialect;
import org.junit.runners.Parameterized;
@ -89,8 +90,12 @@ public class InstantTest extends AbstractJavaTimeTypeTest<Instant, InstantTest.E
)
// => Also test DST start, just in case
.add( 2018, 3, 25, 1, 0, 0, 0, ZONE_PARIS )
.add( 2018, 3, 25, 2, 0, 0, 0, ZONE_PARIS )
.add( 2018, 9, 30, 2, 0, 0, 0, ZONE_AUCKLAND )
.skippedForDialects(
// No idea what Sybase is doing here exactly
dialect -> dialect instanceof SybaseASE15Dialect,
b -> b.add( 2018, 3, 25, 2, 0, 0, 0, ZONE_PARIS )
.add( 2018, 9, 30, 2, 0, 0, 0, ZONE_AUCKLAND )
)
.add( 2018, 9, 30, 3, 0, 0, 0, ZONE_AUCKLAND )
// => Also test dates around 1905-01-01, because the code behaves differently before and after 1905
.add( 1904, 12, 31, 22, 59, 59, 999_999_999, ZONE_PARIS )

View File

@ -29,8 +29,11 @@ import javax.persistence.Lob;
import org.hibernate.Hibernate;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.bytecode.enhancement.BytecodeEnhancerRunner;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -40,6 +43,7 @@ import org.junit.runner.RunWith;
@TestForIssue(jiraKey = "HHH-12555")
@RequiresDialectFeature(DialectChecks.SupportsExpectedLobUsagePattern.class)
@RunWith(BytecodeEnhancerRunner.class)
@SkipForDialect( value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement binary stream handling")
public class LobUnfetchedPropertyTest extends BaseCoreFunctionalTestCase {
@Override

View File

@ -26,6 +26,7 @@ import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.MariaDBDialect;
import org.hibernate.dialect.MySQL5Dialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.type.descriptor.sql.TimestampTypeDescriptor;
import org.hibernate.testing.SkipForDialect;
@ -72,7 +73,11 @@ public class LocalDateTest extends AbstractJavaTimeTypeTest<LocalDate, LocalDate
.add( 1892, 1, 1, ZONE_OSLO )
.add( 1900, 1, 1, ZONE_PARIS )
.add( 1900, 1, 1, ZONE_AMSTERDAM )
.add( 1600, 1, 1, ZONE_AMSTERDAM )
)
.skippedForDialects(
// No idea what Sybase is doing here exactly
dialect -> dialect instanceof SybaseASE15Dialect,
b -> b.add( 1600, 1, 1, ZONE_AMSTERDAM )
)
// HHH-13379: DST end (where Timestamp becomes ambiguous, see JDK-4312621)
// It doesn't seem that any date at midnight can be affected by HHH-13379, but we add some tests just in case

View File

@ -48,14 +48,14 @@ public class TimeAndTimestampTest extends BaseNonConfigCoreFunctionalTestCase {
Event event = new Event();
event.id = 1L;
event.timeValue = new Time( 1000 );
event.timestampValue = new Timestamp( 45678 );
event.timestampValue = new Timestamp( 45677 );
session.persist( event );
} );
doInHibernate( this::sessionFactory, session -> {
Event event = session.find( Event.class, 1L );
assertEquals(1000, event.timeValue.getTime() % TimeUnit.DAYS.toMillis( 1 ));
assertEquals(45678, event.timestampValue.getTime() % TimeUnit.DAYS.toMillis( 1 ));
assertEquals(45677, event.timestampValue.getTime() % TimeUnit.DAYS.toMillis( 1 ));
} );
}

View File

@ -11,6 +11,9 @@ import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
@ -29,6 +32,7 @@ public class ByteTest extends BaseCoreFunctionalTestCase {
@Test
@TestForIssue( jiraKey = "HHH-6533" )
@SkipForDialect( value = SybaseASE15Dialect.class, comment = "Didn't check what's the problem, but I think the DDL type chosen for byte is unsigned")
public void testByteDataPersistenceAndRetrieval() {
Session session = openSession();
Transaction transaction = session.beginTransaction();

View File

@ -10,6 +10,7 @@ hibernate.connection.driver_class @jdbc.driver@
hibernate.connection.url @jdbc.url@
hibernate.connection.username @jdbc.user@
hibernate.connection.password @jdbc.pass@
hibernate.connection.init_sql @connection.init_sql@
hibernate.connection.pool_size 5

View File

@ -19,10 +19,12 @@ public class HolidayCalendar {
private Long id;
private String name;
// Date -> String
private Map holidays = new HashMap();
public HolidayCalendar init() {
name = "default";
DateFormat df = new SimpleDateFormat("yyyy.MM.dd");
try {
holidays.clear();
@ -35,6 +37,14 @@ public class HolidayCalendar {
return this;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Map getHolidays() {
return holidays;
}

View File

@ -16,6 +16,8 @@
<generator class="native"/>
</id>
<property name="name"/>
<map name="holidays" table="CALENDAR_HOLIDAYS" lazy="false">
<key column="CALENDAR_ID"/>
<map-key column="hol_date" type="date"/>

View File

@ -50,6 +50,8 @@ public abstract class AbstractOneSessionTest extends AbstractEnversTest {
}
config.setProperty( Environment.USE_NEW_ID_GENERATOR_MAPPINGS, "true" );
config.setProperty( EnversSettings.USE_REVISION_ENTITY_WITH_NATIVE_ID, "false" );
// These tests always use H2, so we reset the init_sql config here
config.setProperty( "hibernate.connection.init_sql", "" );
addProperties( config );
this.initMappings();

View File

@ -20,6 +20,7 @@ import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.dialect.PostgreSQL81Dialect;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.envers.Audited;
import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase;
import org.hibernate.envers.test.Priority;
@ -39,6 +40,7 @@ import static org.junit.Assert.assertEquals;
@SkipForDialect(Oracle8iDialect.class)
@SkipForDialect(value = PostgreSQL81Dialect.class, jiraKey = "HHH-11477", comment = "@Lob field in HQL predicate fails with error about text = bigint")
@SkipForDialect(value = AbstractHANADialect.class, comment = "HANA doesn't support comparing LOBs with the = operator")
@SkipForDialect(value = SybaseDialect.class, comment = "Sybase doesn't support comparing LOBs with the = operator")
@SkipForDialect(value = DB2Dialect.class, comment = "DB2 jdbc driver doesn't support setNString")
@SkipForDialect(value = DerbyDialect.class, comment = "Derby jdbc driver doesn't support setNString")
public class StringMapLobTest extends BaseEnversJPAFunctionalTestCase {

View File

@ -12,10 +12,12 @@ import java.util.Map;
import javax.persistence.EntityManager;
import org.hibernate.dialect.PostgreSQL82Dialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.envers.test.BaseEnversJPAFunctionalTestCase;
import org.hibernate.envers.test.Priority;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.TestForIssue;
import org.junit.Test;
@ -26,6 +28,7 @@ import static org.junit.Assert.assertEquals;
* @author Chris Cranford
*/
@RequiresDialectFeature(DialectChecks.SupportsExpectedLobUsagePattern.class)
@SkipForDialect( value = SybaseASE15Dialect.class, comment = "jTDS driver doesn't implement binary stream handling")
public class Lobs extends BaseEnversJPAFunctionalTestCase {
private Integer id1;
private Integer id2;

View File

@ -9,6 +9,7 @@ hibernate.connection.driver_class @jdbc.driver@
hibernate.connection.url @jdbc.url@
hibernate.connection.username @jdbc.user@
hibernate.connection.password @jdbc.pass@
hibernate.connection.init_sql @connection.init_sql@
hibernate.connection.pool_size 5

View File

@ -11,10 +11,12 @@ import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.ConnectionProviderJdbcConnectionAccess;
import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.hikaricp.internal.HikariCPConnectionProvider;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test;
@ -27,6 +29,7 @@ import static org.junit.Assert.fail;
/**
* @author Brett Meyer
*/
@SkipForDialect(value = SybaseDialect.class, comment = "The jTDS driver doesn't implement Connection#isValid so this fails")
public class HikariCPConnectionProviderTest extends BaseCoreFunctionalTestCase {
@Test

View File

@ -14,9 +14,11 @@ import javax.persistence.Id;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.hibernate.test.util.PreparedStatementSpyConnectionProvider;
import org.junit.Test;
@ -32,6 +34,7 @@ import static org.mockito.Mockito.verify;
* @author Vlad Mihalcea
*/
@RequiresDialectFeature(DialectChecks.SupportsJdbcDriverProxying.class)
@SkipForDialect(value = SybaseDialect.class, comment = "The jTDS driver doesn't implement Connection#isValid so this fails")
public class HikariCPSkipAutoCommitTest extends BaseCoreFunctionalTestCase {
private PreparedStatementSpyConnectionProvider connectionProvider =

View File

@ -6,14 +6,17 @@
*/
package org.hibernate.test.hikaricp;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.hikaricp.internal.HikariCPConnectionProvider;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.common.connections.BaseTransactionIsolationConfigTest;
/**
* @author Steve Ebersole
*/
@SkipForDialect(value = SybaseDialect.class, comment = "The jTDS driver doesn't implement Connection#isValid so this fails")
public class HikariTransactionIsolationConfigTest extends BaseTransactionIsolationConfigTest {
@Override
protected ConnectionProvider getConnectionProviderUnderTest() {

View File

@ -9,6 +9,7 @@ hibernate.connection.driver_class @jdbc.driver@
hibernate.connection.url @jdbc.url@
hibernate.connection.username @jdbc.user@
hibernate.connection.password @jdbc.pass@
hibernate.connection.init_sql @connection.init_sql@
hibernate.jdbc.batch_size 10
hibernate.connection.provider_class HikariCPConnectionProvider

View File

@ -24,6 +24,8 @@ import org.hibernate.dialect.CockroachDB192Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.testing.SkipForDialect;
@ -89,6 +91,8 @@ public class RefreshUpdatedDataTest extends BaseUnitTestCase {
@Test
@SkipForDialect(value = CockroachDB192Dialect.class, comment = "does not support nested transactions")
@SkipForDialect(value = DerbyDialect.class, comment = "Derby does not support nested transactions")
@SkipForDialect(SybaseASE15Dialect.class)
@SkipForDialect(HSQLDialect.class)
public void testUpdateAndFlushThenRefresh() {
final String BEFORE = "before";

View File

@ -19,10 +19,12 @@ public class HolidayCalendar {
private Long id;
private String name;
// Date -> String
private Map holidays = new HashMap();
public HolidayCalendar init() {
name = "default";
DateFormat df = new SimpleDateFormat("yyyy.MM.dd");
try {
holidays.clear();
@ -35,6 +37,14 @@ public class HolidayCalendar {
return this;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Map getHolidays() {
return holidays;
}

View File

@ -16,6 +16,8 @@
<generator class="native"/>
</id>
<property name="name"/>
<map name="holidays" table="CALENDAR_HOLIDAYS" lazy="false">
<key column="CALENDAR_ID"/>
<map-key column="hol_date" type="date"/>

Some files were not shown because too many files have changed in this diff Show More