From 805600dd34301e935a8c9bd06d73a99558ac085e Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Tue, 21 Jul 2015 12:01:39 -0500 Subject: [PATCH] HHH-9956 - Enable derby database profile --- build.gradle | 4 +- databases/.gitignore | 1 + databases/derby/matrix.gradle | 42 +++++++++++++++++++ .../derby/resources/hibernate.properties | 29 +++++++++++++ .../src/test/resources/hibernate.properties | 17 +++++--- 5 files changed, 86 insertions(+), 7 deletions(-) create mode 100644 databases/derby/matrix.gradle create mode 100644 databases/derby/resources/hibernate.properties diff --git a/build.gradle b/build.gradle index e49bd69145..d8ded25656 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ buildscript { } dependencies { classpath 'org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1' - classpath 'org.hibernate.build.gradle:hibernate-matrix-testing:1.0.0-SNAPSHOT' + classpath 'org.hibernate.build.gradle:hibernate-matrix-testing:2.0.0-SNAPSHOT' classpath 'org.hibernate.build.gradle:version-injection-plugin:1.0.0' classpath 'org.hibernate.build.gradle:gradle-xjc-plugin:1.0.2.Final' classpath 'com.github.lburgazzoli:lb-karaf-features-gen:1.0.0-SNAPSHOT' @@ -137,7 +137,7 @@ subprojects { subProject -> testRuntime( libraries.h2 ) testRuntime( libraries.woodstox ) - testRuntime( 'org.mariadb.jdbc:mariadb-java-client:1.1.7' ) + testRuntime( 'org.apache.derby:derby:10.10.2.0' ) // 6.6 gave me some NPE problems from within checkstyle... checkstyle 'com.puppycrawl.tools:checkstyle:6.5' diff --git a/databases/.gitignore b/databases/.gitignore index 7ca405c7b6..ee4c8ef2c6 100644 --- a/databases/.gitignore +++ b/databases/.gitignore @@ -1,3 +1,4 @@ !mariadb/ !pgsql/ +!derby/ ./ \ No newline at end of file diff --git a/databases/derby/matrix.gradle b/databases/derby/matrix.gradle new file mode 100644 index 0000000000..d5a657bec0 --- /dev/null +++ b/databases/derby/matrix.gradle @@ -0,0 +1,42 @@ +/* + * 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 . + */ +//databaseProfile { + jdbcDependency 'org.apache.derby:derby:10.10.2.0' + +// testing { +// beforeSuite { +// Test matrixTask = tasks.getByPath( 'matrix_derby' ) as Test +// +// // create the database +// project.ant { +// sql( +// driver: matrixTask.systemProperties.get( 'hibernate.connection.driver_class' ), +// url: 'jdbc:derby:hibernate_orm_test;create=true', +// userid: matrixTask.systemProperties.get( 'hibernate.connection.username' ), +// password: matrixTask.systemProperties.get( 'hibernate.connection.password' ), +// classpath: matrixTask.classpath.asPath, +// 'SELECT 1 FROM SYSIBM.SYSDUMMY1' +// ) +// } +// } +// +//// afterSuite { +//// Test matrixTask = tasks.getByPath( 'matrix_derby' ) as Test +//// +//// // shutdown the database +//// project.ant { +//// sql( +//// driver: matrixTask.systemProperties.get( 'hibernate.connection.driver_class' ), +//// url: 'jdbc:derby:hibernate_orm_test;shutdown=true', +//// userid: matrixTask.systemProperties.get( 'hibernate.connection.username' ), +//// password: matrixTask.systemProperties.get( 'hibernate.connection.password' ), +//// classpath: matrixTask.classpath.asPath +//// ) +//// } +//// } +// } +//} diff --git a/databases/derby/resources/hibernate.properties b/databases/derby/resources/hibernate.properties new file mode 100644 index 0000000000..44b19eac28 --- /dev/null +++ b/databases/derby/resources/hibernate.properties @@ -0,0 +1,29 @@ +# +# 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 . +# + +hibernate.dialect org.hibernate.dialect.DerbyTenSevenDialect +hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver +hibernate.connection.url jdbc:derby:hibernate_orm_test +hibernate.connection.username hibernate_orm_test +hibernate.connection.password hibernate_orm_test + +hibernate.connection.pool_size 5 + +hibernate.show_sql false +hibernate.format_sql true + +hibernate.max_fetch_depth 5 + +hibernate.cache.region_prefix hibernate.test +hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory + +# NOTE: hibernate.jdbc.batch_versioned_data should be set to false when testing with Oracle +hibernate.jdbc.batch_versioned_data true + +javax.persistence.validation.mode=NONE +hibernate.service.allow_crawling=false +hibernate.session.events.log=true \ No newline at end of file diff --git a/hibernate-core/src/test/resources/hibernate.properties b/hibernate-core/src/test/resources/hibernate.properties index 9b7d9559f4..881275bf2a 100644 --- a/hibernate-core/src/test/resources/hibernate.properties +++ b/hibernate-core/src/test/resources/hibernate.properties @@ -5,11 +5,18 @@ # See the lgpl.txt file in the root directory or . # -hibernate.dialect org.hibernate.dialect.H2Dialect -hibernate.connection.driver_class org.h2.Driver -#hibernate.connection.url jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE -hibernate.connection.url jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1 -hibernate.connection.username sa +#hibernate.dialect org.hibernate.dialect.H2Dialect +#hibernate.connection.driver_class org.h2.Driver +##hibernate.connection.url jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE +#hibernate.connection.url jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1 +#hibernate.connection.username sa + + +hibernate.dialect org.hibernate.dialect.DerbyTenSevenDialect +hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver +hibernate.connection.url jdbc:derby:hibernate_orm_test;create=true +hibernate.connection.username hibernate_orm_test +hibernate.connection.password hibernate_orm_test hibernate.connection.pool_size 5