HHH-18037 - Move DerbyDialect to hibernate-community-dialects

Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
Jan Schatteman 2024-07-29 21:59:07 +02:00 committed by Steve Ebersole
parent 08f08b8820
commit 5dd0aa1e1a
82 changed files with 266 additions and 281 deletions

View File

@ -53,7 +53,7 @@ develocity:
pattern: "s390x"
replacement: "$0"
- column: "DB"
pattern: "((?:h2|postgres(?:ql)?|pgsql|mysql|mariadb|mssql|derby|tidb|cockroach(?:db)?|oracle|db2|hsqldb|edb|sybase)(?:.*(?=_ci)|.*))(?:_ci)?"
pattern: "((?:h2|postgres(?:ql)?|pgsql|mysql|mariadb|mssql|tidb|cockroach(?:db)?|oracle|db2|hsqldb|edb|sybase)(?:.*(?=_ci)|.*))(?:_ci)?"
replacement: "$1"
- pattern: "main|HEAD|\\d+.\\d+|PR-\\d+"
replacement: "" # Just remove these tags

View File

@ -42,7 +42,6 @@ jobs:
include:
- rdbms: h2
- rdbms: hsqldb
- rdbms: derby
- rdbms: mysql
- rdbms: mariadb
- rdbms: postgresql

View File

@ -6,8 +6,6 @@ if [ "$RDBMS" == "h2" ]; then
goal=""
elif [ "$RDBMS" == "hsqldb" ] || [ "$RDBMS" == "hsqldb_2_6" ]; then
goal="-Pdb=hsqldb"
elif [ "$RDBMS" == "derby" ]; then
goal="-Pdb=derby"
elif [ "$RDBMS" == "mysql" ] || [ "$RDBMS" == "mysql_8_0" ]; then
goal="-Pdb=mysql_ci"
elif [ "$RDBMS" == "mariadb" ] || [ "$RDBMS" == "mariadb_10_4" ]; then

View File

@ -36,7 +36,7 @@ pipeline {
string(name: 'TCK_VERSION', defaultValue: '3.2.0', description: 'The version of the Jakarta JPA TCK i.e. `2.2.0` or `3.0.1`')
string(name: 'TCK_SHA', defaultValue: '', description: 'The SHA256 of the Jakarta JPA TCK that is distributed under https://download.eclipse.org/jakartaee/persistence/3.1/jakarta-persistence-tck-${TCK_VERSION}.zip.sha256')
string(name: 'TCK_URL', defaultValue: 'https://www.eclipse.org/downloads/download.php?file=/ee4j/jakartaee-tck/jakartaee11/staged/eftl/jakarta-persistence-tck-3.2.0.zip&mirror_id=1', description: 'The URL from which to download the TCK ZIP file. Only needed for testing staged builds. Ensure the TCK_VERSION variable matches the ZIP file name suffix.')
choice(name: 'RDBMS', choices: ['derby','mysql','mssql','oracle','postgresql','db2','sybase'], description: 'The JDK base image version to use for the TCK image.')
choice(name: 'RDBMS', choices: ['mysql','mssql','oracle','postgresql','db2','sybase'], description: 'The JDK base image version to use for the TCK image.')
}
stages {
stage('Build') {
@ -116,9 +116,7 @@ pipeline {
else {
containerName = params.RDBMS
}
def dockerRunOptions
if ( params.RDBMS != 'derby' ) {
dockerRunOptions = "--network=tck-net -e DB_HOST=${containerName}"
def dockerRunOptions = "--network=tck-net -e DB_HOST=${containerName}"
sh """ \
while IFS= read -r container; do
docker network disconnect tck-net \$container || true
@ -127,10 +125,6 @@ pipeline {
docker network create tck-net
docker network connect tck-net ${containerName}
"""
}
else {
dockerRunOptions = ""
}
sh """ \
rm -Rf ./results
docker rm -f tck || true

View File

@ -1,42 +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>.
*/
//databaseProfile {
jdbcDependency 'org.apache.derby:derby:10.15.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
//// )
//// }
//// }
// }
//}

View File

@ -1,25 +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>.
#
hibernate.dialect org.hibernate.dialect.DerbyDialect
hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver
hibernate.connection.url jdbc:derby:target/tmp/derby/hibernate_orm_test;databaseName=hibernate_orm_test;create=true
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
hibernate.service.allow_crawling=false
hibernate.session.events.log=true

View File

@ -103,7 +103,7 @@ hibernate.connection.url jdbc:hsqldb:./build/db/hsqldb/hibernate
## Derby (not supported!)
#hibernate.dialect org.hibernate.dialect.DerbyDialect
#hibernate.dialect org.hibernate.community.dialect.DerbyDialect
#hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver
#hibernate.connection.username
#hibernate.connection.password

View File

@ -89,7 +89,7 @@ hibernate.connection.url @DB_URL@
## Derby (Not supported!)
#hibernate.dialect org.hibernate.dialect.DerbyDialect
#hibernate.dialect org.hibernate.community.dialect.DerbyDialect
#hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver
#hibernate.connection.username
#hibernate.connection.password

View File

@ -4,7 +4,7 @@
* 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.dialect;
package org.hibernate.community.dialect;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
@ -13,19 +13,25 @@ import java.util.Locale;
import org.hibernate.boot.model.FunctionContributions;
import org.hibernate.boot.model.TypeContributions;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DatabaseVersion;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.DmlTargetColumnQualifierSupport;
import org.hibernate.dialect.NationalizationSupport;
import org.hibernate.dialect.RowLockStrategy;
import org.hibernate.dialect.function.CaseLeastGreatestEmulation;
import org.hibernate.dialect.function.CastingConcatFunction;
import org.hibernate.dialect.function.ChrLiteralEmulation;
import org.hibernate.dialect.function.CommonFunctionFactory;
import org.hibernate.dialect.function.CountFunction;
import org.hibernate.dialect.function.DerbyLpadEmulation;
import org.hibernate.dialect.function.DerbyRpadEmulation;
import org.hibernate.community.dialect.function.DerbyLpadEmulation;
import org.hibernate.community.dialect.function.DerbyRpadEmulation;
import org.hibernate.dialect.function.InsertSubstringOverlayEmulation;
import org.hibernate.dialect.identity.DB2IdentityColumnSupport;
import org.hibernate.dialect.identity.IdentityColumnSupport;
import org.hibernate.dialect.pagination.DerbyLimitHandler;
import org.hibernate.community.dialect.pagination.DerbyLimitHandler;
import org.hibernate.dialect.pagination.LimitHandler;
import org.hibernate.dialect.sequence.DerbySequenceSupport;
import org.hibernate.community.dialect.sequence.DerbySequenceSupport;
import org.hibernate.dialect.sequence.SequenceSupport;
import org.hibernate.dialect.temptable.TemporaryTable;
import org.hibernate.dialect.temptable.TemporaryTableKind;
@ -61,7 +67,7 @@ import org.hibernate.sql.ast.spi.SqlAppender;
import org.hibernate.sql.ast.spi.StandardSqlAstTranslatorFactory;
import org.hibernate.sql.ast.tree.Statement;
import org.hibernate.sql.exec.spi.JdbcOperation;
import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorDerbyDatabaseImpl;
import org.hibernate.community.dialect.sequence.SequenceInformationExtractorDerbyDatabaseImpl;
import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor;
import org.hibernate.type.BasicType;
import org.hibernate.type.BasicTypeRegistry;

View File

@ -23,15 +23,15 @@ import org.hibernate.dialect.function.CastingConcatFunction;
import org.hibernate.dialect.function.ChrLiteralEmulation;
import org.hibernate.dialect.function.CommonFunctionFactory;
import org.hibernate.dialect.function.CountFunction;
import org.hibernate.dialect.function.DerbyLpadEmulation;
import org.hibernate.dialect.function.DerbyRpadEmulation;
import org.hibernate.community.dialect.function.DerbyLpadEmulation;
import org.hibernate.community.dialect.function.DerbyRpadEmulation;
import org.hibernate.dialect.function.InsertSubstringOverlayEmulation;
import org.hibernate.dialect.identity.DB2IdentityColumnSupport;
import org.hibernate.dialect.identity.IdentityColumnSupport;
import org.hibernate.dialect.pagination.AbstractLimitHandler;
import org.hibernate.dialect.pagination.DerbyLimitHandler;
import org.hibernate.community.dialect.pagination.DerbyLimitHandler;
import org.hibernate.dialect.pagination.LimitHandler;
import org.hibernate.dialect.sequence.DerbySequenceSupport;
import org.hibernate.community.dialect.sequence.DerbySequenceSupport;
import org.hibernate.dialect.sequence.SequenceSupport;
import org.hibernate.dialect.temptable.TemporaryTable;
import org.hibernate.dialect.temptable.TemporaryTableKind;
@ -65,7 +65,7 @@ import org.hibernate.sql.ast.spi.SqlAppender;
import org.hibernate.sql.ast.spi.StandardSqlAstTranslatorFactory;
import org.hibernate.sql.ast.tree.Statement;
import org.hibernate.sql.exec.spi.JdbcOperation;
import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorDerbyDatabaseImpl;
import org.hibernate.community.dialect.sequence.SequenceInformationExtractorDerbyDatabaseImpl;
import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorNoOpImpl;
import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor;
import org.hibernate.type.BasicType;

View File

@ -4,7 +4,7 @@
* 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.dialect;
package org.hibernate.community.dialect;
import java.util.List;
import java.util.function.Consumer;

View File

@ -4,7 +4,7 @@
* 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.dialect.function;
package org.hibernate.community.dialect.function;
import java.util.List;

View File

@ -4,7 +4,7 @@
* 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.dialect.function;
package org.hibernate.community.dialect.function;
import java.util.List;

View File

@ -4,10 +4,13 @@
* 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.dialect.pagination;
package org.hibernate.community.dialect.pagination;
import java.util.regex.Pattern;
import org.hibernate.dialect.pagination.LimitHandler;
import org.hibernate.dialect.pagination.OffsetFetchLimitHandler;
/**
* A {@link LimitHandler} for Apache Derby, which
* fully supports the ANSI SQL standard syntax

View File

@ -4,12 +4,14 @@
* 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.dialect.sequence;
package org.hibernate.community.dialect.sequence;
import org.hibernate.MappingException;
import org.hibernate.dialect.sequence.DB2SequenceSupport;
import org.hibernate.dialect.sequence.SequenceSupport;
/**
* Sequence support for {@link org.hibernate.dialect.DerbyDialect}.
* Sequence support for {@link org.hibernate.community.dialect.DerbyDialect}.
*
* @author Christian Beikov
*/

View File

@ -4,7 +4,9 @@
* 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.tool.schema.extract.internal;
package org.hibernate.community.dialect.sequence;
import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorLegacyImpl;
/**
* @author Vlad Mihalcea

View File

@ -4,12 +4,12 @@
* 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.orm.test.sql.hand.custom.derby;
package org.hibernate.community.dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.orm.test.sql.hand.custom.CustomStoredProcTestSupport;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.orm.junit.RequiresDialect;
/**
* @author Andrea Boriero
@ -17,6 +17,6 @@ import org.hibernate.testing.RequiresDialect;
@RequiresDialect(DerbyDialect.class)
public class DerbyCustomSQLTest extends CustomStoredProcTestSupport {
public String[] getMappings() {
return new String[] {"sql/hand/custom/derby/Mappings.hbm.xml"};
return new String[] {"derby/Mappings.hbm.xml"};
}
}

View File

@ -4,7 +4,7 @@
* 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.orm.test.jpa.procedure;
package org.hibernate.community.dialect;
import java.sql.Connection;
import java.sql.DriverManager;
@ -18,7 +18,6 @@ import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess;
import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.spi.SessionFactoryImplementor;
@ -48,9 +47,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*/
@RequiresDialect(DerbyDialect.class)
@Jpa(
annotatedClasses = { DateTimeParameterTest.Message.class }
annotatedClasses = { DerbyDateTimeParameterTest.Message.class }
)
public class DateTimeParameterTest {
public class DerbyDateTimeParameterTest {
private static GregorianCalendar nowCal = new GregorianCalendar();
private static Date now = new Date( nowCal.getTime().getTime() );
@ -119,7 +118,7 @@ public class DateTimeParameterTest {
"CREATE PROCEDURE findMessagesByDate(IN chkDt DATE) " +
"language java " +
"dynamic result sets 1 " +
"external name 'org.hibernate.orm.test.jpa.procedure.DateTimeParameterTest.findMessagesByDate' " +
"external name 'org.hibernate.community.dialect.DerbyDateTimeParameterTest.findMessagesByDate' " +
"parameter style java"
);
@ -127,7 +126,7 @@ public class DateTimeParameterTest {
"CREATE PROCEDURE findMessagesByTime(IN chkTime TIME) " +
"language java " +
"dynamic result sets 1 " +
"external name 'org.hibernate.orm.test.jpa.procedure.DateTimeParameterTest.findMessagesByTime' " +
"external name 'org.hibernate.community.dialect.DerbyDateTimeParameterTest.findMessagesByTime' " +
"parameter style java"
);
@ -135,7 +134,7 @@ public class DateTimeParameterTest {
"CREATE PROCEDURE findMessagesByTimestampRange(IN startDt TIMESTAMP, IN endDt TIMESTAMP) " +
"language java " +
"dynamic result sets 1 " +
"external name 'org.hibernate.orm.test.jpa.procedure.DateTimeParameterTest.findMessagesByTimestampRange' " +
"external name 'org.hibernate.community.dialect.DerbyDateTimeParameterTest.findMessagesByTimestampRange' " +
"parameter style java"
);
@ -143,7 +142,7 @@ public class DateTimeParameterTest {
"CREATE PROCEDURE retrieveTimestamp(IN ts1 TIMESTAMP, OUT ts2 TIMESTAMP) " +
"language java " +
"dynamic result sets 0 " +
"external name 'org.hibernate.orm.test.jpa.procedure.DateTimeParameterTest.retrieveTimestamp' " +
"external name 'org.hibernate.community.dialect.DerbyDateTimeParameterTest.retrieveTimestamp' " +
"parameter style java"
);

View File

@ -4,28 +4,40 @@
* 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.orm.test.dialect;
package org.hibernate.community.dialect;
import org.hibernate.dialect.DatabaseVersion;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.query.spi.Limit;
import static org.junit.Assert.assertEquals;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseUnitTestCase;
import org.junit.Test;
import org.hibernate.testing.orm.junit.DomainModel;
import org.hibernate.testing.orm.junit.JiraKey;
import org.hibernate.testing.orm.junit.RequiresDialect;
import org.hibernate.testing.orm.junit.SessionFactory;
import org.hibernate.testing.orm.junit.SessionFactoryScope;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;
/**
* Testing of patched support for Derby limit and offset queries; see HHH-3972
*
* @author Evan Leonard
*/
public class DerbyDialectTestCase extends BaseUnitTestCase {
@SessionFactory
@DomainModel(annotatedClasses = DerbyDialectTestCase.Constrained.class)
public class DerbyDialectTestCase {
@Test
@TestForIssue( jiraKey = "HHH-3972" )
public void testInsertLimitClause() {
@JiraKey( value = "HHH-3972" )
public void testInsertLimitClause(SessionFactoryScope scope) {
final int limit = 50;
final String input = "select * from tablename t where t.cat = 5";
final String expected = "select * from tablename t where t.cat = 5 fetch first ? rows only";
@ -35,8 +47,8 @@ public class DerbyDialectTestCase extends BaseUnitTestCase {
}
@Test
@TestForIssue( jiraKey = "HHH-3972" )
public void testInsertLimitWithOffsetClause() {
@JiraKey( value = "HHH-3972" )
public void testInsertLimitWithOffsetClause(SessionFactoryScope scope) {
final int limit = 50;
final int offset = 200;
final String input = "select * from tablename t where t.cat = 5";
@ -47,8 +59,8 @@ public class DerbyDialectTestCase extends BaseUnitTestCase {
}
@Test
@TestForIssue( jiraKey = "HHH-3972" )
public void testInsertLimitWithForUpdateClause() {
@JiraKey( value = "HHH-3972" )
public void testInsertLimitWithForUpdateClause(SessionFactoryScope scope) {
final int limit = 50;
final int offset = 200;
final String input = "select c11 as col1, c12 as col2, c13 as col13 from t1 for update of c11, c13";
@ -59,8 +71,8 @@ public class DerbyDialectTestCase extends BaseUnitTestCase {
}
@Test
@TestForIssue( jiraKey = "HHH-3972" )
public void testInsertLimitWithWithClause() {
@JiraKey( value = "HHH-3972" )
public void testInsertLimitWithWithClause(SessionFactoryScope scope) {
final int limit = 50;
final int offset = 200;
final String input = "select c11 as col1, c12 as col2, c13 as col13 from t1 where flight_id between 'AA1111' and 'AA1112' with rr";
@ -71,8 +83,8 @@ public class DerbyDialectTestCase extends BaseUnitTestCase {
}
@Test
@TestForIssue( jiraKey = "HHH-3972" )
public void testInsertLimitWithForUpdateAndWithClauses() {
@JiraKey( value = "HHH-3972" )
public void testInsertLimitWithForUpdateAndWithClauses(SessionFactoryScope scope) {
final int limit = 50;
final int offset = 200;
final String input = "select c11 as col1, c12 as col2, c13 as col13 from t1 where flight_id between 'AA1111' and 'AA1112' for update of c11,c13 with rr";
@ -81,6 +93,13 @@ public class DerbyDialectTestCase extends BaseUnitTestCase {
final String actual = new DerbyDialect().getLimitHandler().processSql( input, toRowSelection( offset, limit ) );
assertEquals( expected, actual );
}
@RequiresDialect( DerbyDialect.class )
@Test void testInsertConflictOnConstraintDoNothing(SessionFactoryScope scope) {
scope.getSessionFactory().getSchemaManager().truncateMappedObjects();
scope.inTransaction( s -> s.persist(new Constrained()));
scope.inTransaction( s -> s.createMutationQuery("insert into Constrained(id, name, count) values (4,'Gavin',69) on conflict on constraint count_name_key do nothing").executeUpdate());
scope.inSession( s -> Assertions.assertEquals( 69, s.createSelectionQuery( "select count from Constrained", int.class).getSingleResult()));
}
private Limit toRowSelection(int firstRow, int maxRows) {
Limit selection = new Limit();
@ -88,4 +107,15 @@ public class DerbyDialectTestCase extends BaseUnitTestCase {
selection.setMaxRows( maxRows );
return selection;
}
@Entity(name = "Constrained")
@Table(uniqueConstraints = @UniqueConstraint(name = "count_name_key", columnNames = {"count","name"}))
static class Constrained {
@Id
@GeneratedValue
long id;
String name = "Gavin";
int count = 69;
}
}

View File

@ -4,7 +4,7 @@
* 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.orm.test.jpa.procedure;
package org.hibernate.community.dialect;
import java.sql.Connection;
import java.sql.DriverManager;
@ -14,14 +14,14 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess;
import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.orm.test.jpa.BaseEntityManagerFunctionalTestCase;
import org.hibernate.orm.test.jpa.procedure.User;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.orm.junit.FailureExpected;
import org.hibernate.testing.orm.junit.RequiresDialect;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@ -41,11 +41,11 @@ import static org.junit.Assert.fail;
* @author Steve Ebersole
*/
@RequiresDialect(DerbyDialect.class)
public class JpaTckUsageTest extends BaseEntityManagerFunctionalTestCase {
public class DerbyJpaTckUsageTest extends BaseEntityManagerFunctionalTestCase {
@Override
protected Class<?>[] getAnnotatedClasses() {
return new Class[]{User.class};
return new Class[]{ User.class};
}
@Test
@ -93,7 +93,7 @@ public class JpaTckUsageTest extends BaseEntityManagerFunctionalTestCase {
}
@Test
@FailureExpected( jiraKey = "HHH-8416", message = "JPA TCK challenge" )
@FailureExpected( jiraKey = "HHH-8416", reason = "JPA TCK challenge" )
public void testHasMoreResultsHandlingTckChallenge() {
EntityManager em = getOrCreateEntityManager();
em.getTransaction().begin();
@ -202,7 +202,7 @@ public class JpaTckUsageTest extends BaseEntityManagerFunctionalTestCase {
}
@Test
@FailureExpected( jiraKey = "HHH-8395", message = "Out of the frying pan into the fire: https://issues.apache.org/jira/browse/DERBY-211" )
@FailureExpected( jiraKey = "HHH-8395", reason = "Out of the frying pan into the fire: https://issues.apache.org/jira/browse/DERBY-211" )
public void testExecuteUpdate() {
EntityManager em = getOrCreateEntityManager();
em.getTransaction().begin();
@ -321,7 +321,7 @@ public class JpaTckUsageTest extends BaseEntityManagerFunctionalTestCase {
"CREATE PROCEDURE findOneUser() " +
"language java " +
"dynamic result sets 1 " +
"external name 'org.hibernate.orm.test.jpa.procedure.JpaTckUsageTest.findOneUser' " +
"external name 'org.hibernate.community.dialect.DerbyJpaTckUsageTest.findOneUser' " +
"parameter style java"
);
}
@ -330,7 +330,7 @@ public class JpaTckUsageTest extends BaseEntityManagerFunctionalTestCase {
statement.execute(
"CREATE PROCEDURE deleteAllUsers() " +
"language java " +
"external name 'org.hibernate.orm.test.jpa.procedure.JpaTckUsageTest.deleteAllUsers' " +
"external name 'org.hibernate.community.dialect.DerbyJpaTckUsageTest.deleteAllUsers' " +
"parameter style java"
);
}

View File

@ -4,10 +4,11 @@
* 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.orm.test.dialect;
package org.hibernate.community.dialect;
import org.hibernate.dialect.pagination.AbstractLimitHandler;
import org.hibernate.dialect.pagination.DerbyLimitHandler;
import org.hibernate.community.dialect.pagination.DerbyLimitHandler;
import org.hibernate.orm.test.dialect.AbstractLimitHandlerTest;
/**
* @author Yanming Zhou

View File

@ -4,7 +4,7 @@
* 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.orm.test.sql.hand.custom.derby;
package org.hibernate.community.dialect;
import java.sql.Connection;
import java.sql.DriverManager;

View File

@ -4,7 +4,7 @@
* 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.orm.test.jpa.compliance;
package org.hibernate.community.dialect;
import java.sql.Connection;
import java.sql.DriverManager;
@ -16,7 +16,6 @@ import java.util.Date;
import java.util.function.Consumer;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.testing.orm.junit.EntityManagerFactoryScope;
@ -46,11 +45,11 @@ import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.fail;
@Jpa(
annotatedClasses = StoredProcedureTest.Person.class,
annotatedClasses = DerbyStoredProcedureTest.Person.class,
properties = @Setting(name = AvailableSettings.JPA_LOAD_BY_ID_COMPLIANCE, value = "true")
)
@RequiresDialect(value = DerbyDialect.class)
public class StoredProcedureTest {
public class DerbyStoredProcedureTest {
@BeforeEach
public void setUp(EntityManagerFactoryScope scope) {
@ -186,7 +185,7 @@ public class StoredProcedureTest {
try {
statement.execute(
"CREATE PROCEDURE SelectByDate(in IN_PARAM DATE, out OUT_PARAMAM INTEGER) " +
"language java external name 'org.hibernate.orm.test.jpa.compliance.StoredProcedureTest.selectByDate' " +
"language java external name 'org.hibernate.community.dialect.DerbyStoredProcedureTest.selectByDate' " +
"parameter style java"
);
}

View File

@ -0,0 +1,85 @@
/*
* 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.community.dialect;
import org.hibernate.HibernateException;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.orm.test.jpa.transaction.JtaPlatformSettingProvider;
import org.hibernate.testing.jta.TestingJtaPlatformImpl;
import org.hibernate.testing.orm.junit.EntityManagerFactoryScope;
import org.hibernate.testing.orm.junit.JiraKey;
import org.hibernate.testing.orm.junit.Jpa;
import org.hibernate.testing.orm.junit.RequiresDialect;
import org.hibernate.testing.orm.junit.Setting;
import org.hibernate.testing.orm.junit.SettingProvider;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.function.ThrowingConsumer;
import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import jakarta.persistence.LockTimeoutException;
import jakarta.persistence.ParameterMode;
import jakarta.persistence.QueryTimeoutException;
import jakarta.transaction.Status;
import jakarta.transaction.TransactionManager;
import static org.assertj.core.api.Assertions.assertThat;
@Jpa(
integrationSettings = {
@Setting(name = AvailableSettings.CONNECTION_PROVIDER, value = "org.hibernate.testing.jta.JtaAwareConnectionProviderImpl"),
@Setting(name = AvailableSettings.JPA_TRANSACTION_TYPE, value = "JTA")
},
settingProviders = {
@SettingProvider(
settingName = AvailableSettings.JTA_PLATFORM,
provider = JtaPlatformSettingProvider.class
)
})
@JiraKey("HHH-10619")
public class DerbyTransactionTimeoutTest {
@Test
@RequiresDialect(DerbyDialect.class)
public void testDerby(EntityManagerFactoryScope scope) throws Throwable {
test( scope, entityManager -> {
entityManager.createNativeQuery( "create procedure sleep(in secs bigint, out slept bigint) no sql language java parameter style java deterministic external name '" + DerbyTransactionTimeoutTest.class.getName() + ".sleep'" )
.executeUpdate();
entityManager.createStoredProcedureQuery( "sleep" )
.registerStoredProcedureParameter( 1, Long.class, ParameterMode.IN )
.registerStoredProcedureParameter( 2, Long.class, ParameterMode.OUT )
.setParameter( 1, 10_000L )
.execute();
});
}
private void test(EntityManagerFactoryScope scope, ThrowingConsumer<EntityManager> consumer) throws Throwable {
TransactionManager transactionManager = TestingJtaPlatformImpl.INSTANCE.getTransactionManager();
EntityManagerFactory entityManagerFactory = scope.getEntityManagerFactory();
transactionManager.setTransactionTimeout( 2 );
transactionManager.begin();
try (EntityManager entityManager = entityManagerFactory.createEntityManager()) {
entityManager.joinTransaction();
consumer.accept( entityManager );
}
catch (QueryTimeoutException | LockTimeoutException ex) {
// This is fine
}
catch (HibernateException ex) {
assertThat( ex.getMessage() ).isEqualTo( "Transaction was rolled back in a different thread" );
}
finally {
assertThat( transactionManager.getStatus() ).isIn( Status.STATUS_ROLLEDBACK, Status.STATUS_ROLLING_BACK, Status.STATUS_MARKED_ROLLBACK );
transactionManager.rollback();
}
}
}

View File

@ -235,7 +235,7 @@
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 2
EXTERNAL NAME 'org.hibernate.orm.test.sql.hand.custom.derby.DerbyStoreProcedures.selectAllEmployments'
EXTERNAL NAME 'org.hibernate.community.dialect.DerbyStoreProcedures.selectAllEmployments'
</create>
<drop>
DROP PROCEDURE selectAllEmployments
@ -250,7 +250,7 @@
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 2
EXTERNAL NAME 'org.hibernate.orm.test.sql.hand.custom.derby.DerbyStoreProcedures.paramHandling'
EXTERNAL NAME 'org.hibernate.community.dialect.DerbyStoreProcedures.paramHandling'
</create>
<drop>
DROP PROCEDURE paramHandling
@ -264,7 +264,7 @@
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 2
EXTERNAL NAME 'org.hibernate.orm.test.sql.hand.custom.derby.DerbyStoreProcedures.simpleScalar'
EXTERNAL NAME 'org.hibernate.community.dialect.DerbyStoreProcedures.simpleScalar'
</create>
<drop>
DROP PROCEDURE simpleScalar

View File

@ -264,7 +264,7 @@ tasks.withType( Test.class ).each { test ->
test.beforeTest { descriptor ->
//println "Starting test: " + descriptor
}
if ( project.db == "h2" || project.db == "hsqldb" || project.db == "derby" ) {
if ( project.db == "h2" || project.db == "hsqldb" ) {
// Parallel test runs when running with in-memory databases
test.maxParallelForks = Runtime.runtime.availableProcessors().intdiv( 2 ) ?: 1
}

View File

@ -11,7 +11,6 @@ import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DB2iDialect;
import org.hibernate.dialect.DB2zDialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.HANADialect;
@ -50,11 +49,6 @@ public class DefaultDialectSelector implements DialectSelector {
case "DB2390V8":
case "DB2z":
return DB2zDialect.class;
case "DerbyTenFive":
case "DerbyTenSix":
case "DerbyTenSeven":
case "Derby":
return DerbyDialect.class;
case "H2":
return H2Dialect.class;
case "HANARowStore":

View File

@ -62,23 +62,6 @@ public enum Database {
}
},
DERBY {
@Override
public Dialect createDialect(DialectResolutionInfo info) {
return new DerbyDialect( info );
}
@Override
public boolean productNameMatches(String databaseName) {
return "Apache Derby".equals( databaseName );
}
@Override
public String getDriverClassName(String jdbcUrl) {
return jdbcUrl.startsWith( "jdbc:derby://" )
? "org.apache.derby.jdbc.ClientDriver"
: "org.apache.derby.jdbc.EmbeddedDriver";
}
},
ENTERPRISEDB {
@Override
public Dialect createDialect(DialectResolutionInfo info) {

View File

@ -40,6 +40,7 @@ public class DialectFactoryImpl implements DialectFactory, ServiceRegistryAwareS
"org.hibernate.community.dialect.DerbyTenFiveDialect",
"org.hibernate.community.dialect.DerbyTenSevenDialect",
"org.hibernate.community.dialect.DerbyTenSixDialect",
"org.hibernate.community.dialect.DerbyDialect",
"org.hibernate.community.dialect.MariaDB10Dialect",
"org.hibernate.community.dialect.MariaDB53Dialect",
"org.hibernate.community.dialect.MariaDB102Dialect",

View File

@ -19,7 +19,7 @@ import java.util.Set;
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.SybaseDialect;
@ -29,12 +29,9 @@ import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.hibernate.testing.orm.junit.SessionFactoryScope;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import jakarta.persistence.OptimisticLockException;
import jakarta.persistence.SchemaManager;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

View File

@ -20,7 +20,6 @@ import org.hibernate.cfg.AvailableSettings;
import org.hibernate.cfg.JdbcSettings;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DatabaseVersion;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.HANADialect;
@ -104,8 +103,6 @@ public class MetadataAccessTests {
return Stream.of(
Arguments.of( "DB2", DB2Dialect.class,
getVersionConstant( DB2Dialect.class, "MINIMUM_VERSION") ),
Arguments.of( "Apache Derby", DerbyDialect.class,
getVersionConstant( DerbyDialect.class, "MINIMUM_VERSION") ),
Arguments.of( "EnterpriseDB", PostgresPlusDialect.class,
getVersionConstant( PostgreSQLDialect.class, "MINIMUM_VERSION") ),
Arguments.of( "H2", H2Dialect.class,

View File

@ -20,7 +20,7 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.SybaseASEDialect;

View File

@ -10,7 +10,6 @@ import org.hibernate.HibernateException;
import org.hibernate.boot.registry.BootstrapServiceRegistry;
import org.hibernate.boot.registry.BootstrapServiceRegistryBuilder;
import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.boot.registry.selector.spi.StrategySelectionException;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.*;
@ -141,10 +140,6 @@ public class DialectFactoryTest extends BaseUnitTestCase {
testDetermination( "PostgreSQL", 9, 6, PostgreSQLDialect.class, resolver );
testDetermination( "PostgreSQL", 10, 0, PostgreSQLDialect.class, resolver );
testDetermination( "EnterpriseDB", 9, 2, PostgresPlusDialect.class, resolver );
testDetermination( "Apache Derby", 10, 4, DerbyDialect.class, resolver );
testDetermination( "Apache Derby", 10, 5, DerbyDialect.class, resolver );
testDetermination( "Apache Derby", 10, 6, DerbyDialect.class, resolver );
testDetermination( "Apache Derby", 11, 5, DerbyDialect.class, resolver );
testDetermination( "Microsoft SQL Server Database", SQLServerDialect.class, resolver );
testDetermination( "Microsoft SQL Server", SQLServerDialect.class, resolver );
testDetermination( "Sybase SQL Server", SybaseASEDialect.class, resolver );

View File

@ -26,7 +26,7 @@ import org.hibernate.community.dialect.FirebirdDialect;
import org.hibernate.dialect.HANADialect;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.MariaDBDialect;

View File

@ -28,10 +28,10 @@ import org.hibernate.Transaction;
import org.hibernate.TypeMismatchException;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.HANADialect;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.MySQLDialect;
@ -49,7 +49,6 @@ import org.hibernate.orm.test.any.hbm.StringPropertyValue;
import org.hibernate.query.Query;
import org.hibernate.query.SyntaxException;
import org.hibernate.query.spi.QueryImplementor;
import org.hibernate.query.sqm.ParsingException;
import org.hibernate.query.sqm.SqmExpressible;
import org.hibernate.query.sqm.internal.QuerySqmImpl;
import org.hibernate.query.sqm.tree.domain.SqmPath;

View File

@ -1,6 +1,6 @@
package org.hibernate.orm.test.hql;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.testing.orm.junit.DomainModel;
import org.hibernate.testing.orm.junit.SessionFactory;
import org.hibernate.testing.orm.junit.SessionFactoryScope;

View File

@ -26,7 +26,7 @@ import org.hibernate.ScrollableResults;
import org.hibernate.Session;
import org.hibernate.community.dialect.FirebirdDialect;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.OracleDialect;

View File

@ -2,7 +2,7 @@ package org.hibernate.orm.test.hql;
import java.time.LocalDate;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.testing.orm.junit.DomainModel;
import org.hibernate.testing.orm.junit.JiraKey;

View File

@ -11,7 +11,7 @@ import org.hibernate.ScrollMode;
import org.hibernate.ScrollableResults;
import org.hibernate.dialect.HANADialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.SybaseASEDialect;
import org.hibernate.query.SemanticException;

View File

@ -12,7 +12,7 @@ import java.util.List;
import org.hibernate.HibernateException;
import org.hibernate.QueryException;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.query.Query;
import org.hibernate.testing.TestForIssue;

View File

@ -6,7 +6,7 @@
*/
package org.hibernate.orm.test.hql.bitwise;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.testing.orm.junit.DomainModel;
import org.hibernate.testing.orm.junit.SessionFactory;
import org.hibernate.testing.orm.junit.SessionFactoryScope;

View File

@ -10,7 +10,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.Dialect;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.exception.GenericJDBCException;

View File

@ -17,7 +17,7 @@ import java.sql.Statement;
import org.hibernate.JDBCException;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.engine.jdbc.spi.JdbcCoordinator;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.resource.jdbc.ResourceRegistry;

View File

@ -21,8 +21,7 @@ import jakarta.persistence.PersistenceException;
import javax.sql.DataSource;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.jpa.HibernatePersistenceProvider;
@ -48,7 +47,7 @@ public class DataSourceInjectionTest {
// otherwise the FakeDataSourceException will be eaten trying to resolve the Dialect
final Map<String, Object> intgOverrides = Collections.singletonMap(
AvailableSettings.DIALECT,
DerbyDialect.class
HSQLDialect.class
);
final HibernatePersistenceProvider provider = new HibernatePersistenceProvider();

View File

@ -3,11 +3,10 @@ package org.hibernate.orm.test.jpa.criteria;
import java.util.List;
import jakarta.persistence.criteria.CriteriaBuilder;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.function.CommonFunctionFactory;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.query.criteria.HibernateCriteriaBuilder;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.orm.junit.EntityManagerFactoryScope;

View File

@ -17,7 +17,7 @@ import java.util.List;
import org.hibernate.Session;
import org.hibernate.community.dialect.AltibaseDialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.PostgresPlusDialect;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.orm.test.jpa.metamodel.AbstractMetamodelSpecificTest;

View File

@ -24,7 +24,7 @@ import org.hibernate.community.dialect.AltibaseDialect;
import org.hibernate.community.dialect.FirebirdDialect;
import org.hibernate.dialect.HANADialect;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.MariaDBDialect;
import org.hibernate.dialect.MySQLDialect;
@ -46,7 +46,6 @@ import org.jboss.logging.Logger;
import jakarta.persistence.LockModeType;
import jakarta.persistence.LockTimeoutException;
import jakarta.persistence.OptimisticLockException;
import jakarta.persistence.PersistenceException;
import jakarta.persistence.PessimisticLockException;
import jakarta.persistence.Query;

View File

@ -30,7 +30,7 @@ import org.hibernate.dialect.HANADialect;
import org.hibernate.dialect.AbstractTransactSQLDialect;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.HSQLDialect;

View File

@ -29,7 +29,7 @@ import org.hibernate.QueryException;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.PostgresPlusDialect;

View File

@ -13,7 +13,6 @@ import org.hibernate.cfg.AvailableSettings;
import org.hibernate.dialect.AbstractTransactSQLDialect;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.MySQLDialect;
@ -74,20 +73,6 @@ public class TransactionTimeoutTest {
});
}
@Test
@RequiresDialect(DerbyDialect.class)
public void testDerby(EntityManagerFactoryScope scope) throws Throwable {
test( scope, entityManager -> {
entityManager.createNativeQuery( "create procedure sleep(in secs bigint, out slept bigint) no sql language java parameter style java deterministic external name '" + TransactionTimeoutTest.class.getName() + ".sleep'" )
.executeUpdate();
entityManager.createStoredProcedureQuery( "sleep" )
.registerStoredProcedureParameter( 1, Long.class, ParameterMode.IN )
.registerStoredProcedureParameter( 2, Long.class, ParameterMode.OUT )
.setParameter( 1, 10_000L )
.execute();
});
}
@Test
@RequiresDialect(PostgreSQLDialect.class)
@RequiresDialect(CockroachDialect.class)

View File

@ -18,14 +18,12 @@ import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.community.dialect.AltibaseDialect;
import org.hibernate.dialect.HANADialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.metamodel.mapping.internal.BasicAttributeMapping;
import org.hibernate.metamodel.spi.MappingMetamodelImplementor;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.testing.orm.junit.RequiresDialect;
import org.hibernate.type.SqlTypes;
import org.hibernate.type.descriptor.jdbc.JdbcType;
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeRegistry;

View File

@ -16,7 +16,7 @@ import jakarta.persistence.Table;
import org.hibernate.annotations.Subselect;
import org.hibernate.annotations.Synchronize;
import org.hibernate.community.dialect.FirebirdDialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.SybaseASEDialect;
import org.hibernate.testing.orm.junit.EntityManagerFactoryScope;

View File

@ -13,7 +13,7 @@ import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.community.dialect.AltibaseDialect;
import org.hibernate.dialect.HANADialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.dialect.SybaseDialect;
import org.hibernate.metamodel.mapping.internal.BasicAttributeMapping;

View File

@ -17,7 +17,7 @@ import org.hibernate.annotations.Formula;
import org.hibernate.community.dialect.FirebirdDialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.OracleDialect;

View File

@ -5,7 +5,7 @@ import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import org.hibernate.annotations.GeneratedColumn;
import org.hibernate.community.dialect.AltibaseDialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.PostgreSQLDialect;

View File

@ -15,7 +15,7 @@ import java.time.temporal.ChronoUnit;
import org.hibernate.cfg.MappingSettings;
import org.hibernate.community.dialect.AltibaseDialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.HANADialect;
import org.hibernate.dialect.OracleDialect;

View File

@ -16,7 +16,7 @@ import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.cfg.MappingSettings;
import org.hibernate.community.dialect.AltibaseDialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.HANADialect;
import org.hibernate.dialect.OracleDialect;

View File

@ -1,6 +1,5 @@
package org.hibernate.orm.test.orderby;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.PostgreSQLDialect;
@ -9,7 +8,6 @@ import org.hibernate.testing.orm.junit.DomainModel;
import org.hibernate.testing.orm.junit.RequiresDialect;
import org.hibernate.testing.orm.junit.SessionFactory;
import org.hibernate.testing.orm.junit.SessionFactoryScope;
import org.hibernate.testing.orm.junit.SkipForDialect;
import org.junit.jupiter.api.Test;
import jakarta.persistence.Column;

View File

@ -8,7 +8,7 @@ package org.hibernate.orm.test.pagination;
import java.util.List;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.testing.orm.domain.StandardDomainModel;
import org.hibernate.testing.orm.domain.gambit.EntityOfLists;

View File

@ -10,7 +10,7 @@ import jakarta.persistence.criteria.CriteriaQuery;
import jakarta.persistence.criteria.ParameterExpression;
import jakarta.persistence.criteria.Root;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.query.criteria.HibernateCriteriaBuilder;
import org.hibernate.query.criteria.JpaCriteriaQuery;

View File

@ -17,7 +17,7 @@ import java.util.Date;
import java.util.List;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.query.criteria.HibernateCriteriaBuilder;
import org.hibernate.query.criteria.JpaExpression;

View File

@ -9,9 +9,6 @@ package org.hibernate.orm.test.query.hql;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.Dialect;
import org.hibernate.testing.orm.junit.DomainModel;
import org.hibernate.testing.orm.junit.SessionFactory;
import org.hibernate.testing.orm.junit.SessionFactoryScope;

View File

@ -11,7 +11,7 @@ import org.hibernate.QueryException;
import org.hibernate.community.dialect.AltibaseDialect;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.MariaDBDialect;
@ -57,8 +57,6 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.hamcrest.Matchers;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.isOneOf;

View File

@ -5,7 +5,7 @@ import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.MySQLDialect;

View File

@ -6,7 +6,7 @@
*/
package org.hibernate.orm.test.query.hql;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.jdbc.SQLStatementInspector;

View File

@ -15,7 +15,7 @@ import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.testing.orm.junit.DomainModel;
import org.hibernate.testing.orm.junit.Jira;

View File

@ -17,7 +17,7 @@ import jakarta.persistence.ManyToMany;
import org.hibernate.Hibernate;
import org.hibernate.annotations.Imported;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.orm.junit.DomainModel;

View File

@ -17,7 +17,7 @@ import jakarta.persistence.JoinColumn;
import jakarta.persistence.OneToMany;
import org.hibernate.Hibernate;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.orm.junit.DomainModel;

View File

@ -13,7 +13,7 @@ import java.time.Instant;
import java.util.List;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.dialect.SybaseDialect;

View File

@ -18,7 +18,7 @@ import org.hibernate.cfg.AvailableSettings;
import org.hibernate.community.dialect.AltibaseDialect;
import org.hibernate.community.dialect.FirebirdDialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.orm.test.jpa.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.tool.schema.spi.SchemaManagementException;

View File

@ -27,7 +27,7 @@ import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.CustomRunner;
import org.hibernate.testing.util.ServiceRegistryUtil;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.tool.hbm2ddl.SchemaUpdate;
import org.hibernate.tool.schema.TargetType;
import org.hibernate.tool.schema.spi.SchemaManagementException;

View File

@ -13,9 +13,6 @@ import org.hibernate.ScrollMode;
import org.hibernate.ScrollableResults;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.cfg.MappingSettings;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.dialect.Dialect;
import org.hibernate.query.Query;
import org.hibernate.testing.orm.junit.DomainModel;

View File

@ -22,8 +22,6 @@ public class DefaultDialectSelectorTest {
public void verifyAllDialectNamingResolve() {
testDialectNamingResolution( DB2Dialect.class );
testDialectNamingResolution( DerbyDialect.class );
testDialectNamingResolution( H2Dialect.class );
testDialectNamingResolution( HANADialect.class );
testDialectNamingResolution( HSQLDialect.class );

View File

@ -18,7 +18,7 @@ import org.hibernate.annotations.FractionalSeconds;
import org.hibernate.boot.spi.MetadataImplementor;
import org.hibernate.community.dialect.AltibaseDialect;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.HANADialect;
import org.hibernate.dialect.MariaDBDialect;

View File

@ -19,7 +19,7 @@ import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.boot.spi.MetadataImplementor;
import org.hibernate.community.dialect.AltibaseDialect;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.HANADialect;
import org.hibernate.dialect.MariaDBDialect;

View File

@ -8,7 +8,7 @@ package org.hibernate.orm.test.type;
import org.hibernate.community.dialect.AltibaseDialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.OracleDialect;

View File

@ -53,7 +53,7 @@ configurations {
}
tasks.withType( Test.class ).each { test ->
if ( project.db == "h2" || project.db == "hsqldb" || project.db == "derby" ) {
if ( project.db == "h2" || project.db == "hsqldb" ) {
// Parallel test runs when running with in-memory databases
test.maxParallelForks = Runtime.runtime.availableProcessors().intdiv( 2 ) ?: 1
}

View File

@ -16,7 +16,7 @@ import jakarta.persistence.Lob;
import org.hibernate.dialect.HANADialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.SybaseDialect;

View File

@ -17,7 +17,7 @@ import jakarta.persistence.Lob;
import org.hibernate.annotations.Nationalized;
import org.hibernate.dialect.HANADialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.SybaseDialect;

View File

@ -21,7 +21,7 @@ import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.dialect.SybaseASEDialect;

View File

@ -9,7 +9,7 @@ package org.hibernate.testing;
import org.hibernate.community.dialect.FirebirdDialect;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.DialectDelegateWrapper;
import org.hibernate.dialect.HANADialect;

View File

@ -13,7 +13,7 @@ import org.hibernate.community.dialect.FirebirdDialect;
import org.hibernate.dialect.HANADialect;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DB2Dialect;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.community.dialect.DerbyDialect;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.DialectDelegateWrapper;
import org.hibernate.dialect.H2Dialect;