Fix some tests and config. Enable all documentation tests. Add profile for PG13

This commit is contained in:
Christian Beikov 2021-08-31 10:06:37 +02:00
parent bf79ff6cfd
commit 1a3629a571
8 changed files with 33 additions and 27 deletions

View File

@ -37,7 +37,9 @@ jobs:
experimental: false
- rdbms: mariadb
experimental: false
- rdbms: postgresql
- rdbms: postgresql_9_5
experimental: false
- rdbms: postgresql_13
experimental: false
- rdbms: oracle
experimental: false

18
Jenkinsfile vendored
View File

@ -27,7 +27,8 @@ stage('Configure') {
buildEnv('8', 'derby'),
buildEnv('8', 'mysql8'),
buildEnv('8', 'mariadb'),
buildEnv('8', 'postgresql'),
buildEnv('8', 'postgresql_9_5'),
buildEnv('8', 'postgresql_13'),
buildEnv('8', 'oracle'),
buildEnv('8', 'oracle_ee'),
buildEnv('8', 'db2'),
@ -84,14 +85,22 @@ stage('Build') {
sh "./docker_db.sh mariadb"
containerName = "mariadb"
break;
case "postgresql":
case "postgresql_9_5":
// use the postgis image to enable the PGSQL GIS (spatial) extension
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
docker.image('postgis:9.5-3.0').pull()
docker.image('postgis/postgis:9.5-2.5').pull()
}
sh "./docker_db.sh postgresql_9_5"
containerName = "postgres"
break;
case "postgresql_13":
// use the postgis image to enable the PGSQL GIS (spatial) extension
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
docker.image('postgis/postgis:13-3.1').pull()
}
sh "./docker_db.sh postgresql_13"
containerName = "postgres"
break;
case "oracle":
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
docker.image('quillbuilduser/oracle-18-xe').pull()
@ -144,7 +153,8 @@ stage('Build') {
case "mysql8":
goal = "-Pdb=mysql_ci"
break;
case "postgresql":
case "postgresql_9_5":
case "postgresql_13":
goal = "-Pdb=pgsql_ci"
break;
case "oracle":

View File

@ -9,7 +9,9 @@ elif [ "$RDBMS" == "mysql" ]; then
goal="-Pdb=mysql_ci"
elif [ "$RDBMS" == "mariadb" ]; then
goal="-Pdb=mariadb_ci"
elif [ "$RDBMS" == "postgresql" ]; then
elif [ "$RDBMS" == "postgresql_9_5" ]; then
goal="-Pdb=pgsql_ci"
elif [ "$RDBMS" == "postgresql_13" ]; then
goal="-Pdb=pgsql_ci"
elif [ "$RDBMS" == "oracle" ]; then
# I have no idea why, but these tests don't work on GH Actions

View File

@ -8,8 +8,10 @@ elif [ "$RDBMS" == 'mysql8' ]; then
bash $DIR/../docker_db.sh mysql_8_0
elif [ "$RDBMS" == 'mariadb' ]; then
bash $DIR/../docker_db.sh mariadb
elif [ "$RDBMS" == 'postgresql' ]; then
elif [ "$RDBMS" == 'postgresql_9_5' ]; then
bash $DIR/../docker_db.sh postgresql_9_5
elif [ "$RDBMS" == 'postgresql_13' ]; then
bash $DIR/../docker_db.sh postgresql_13
elif [ "$RDBMS" == 'db2' ]; then
bash $DIR/../docker_db.sh db2
elif [ "$RDBMS" == 'oracle' ]; then

View File

@ -73,12 +73,12 @@ mariadb() {
postgresql_9_5() {
docker rm -f postgres || true
docker run --name postgres -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p5432:5432 -d postgres:9.5
docker run --name postgres -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p5432:5432 -d postgis/postgis:9.5-2.5
}
postgresql_13() {
docker rm -f postgres || true
docker run --name postgres -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p5432:5432 -d postgres:13.0
docker run --name postgres -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p5432:5432 -d postgis/postgis:13-3.1
}
edb() {

View File

@ -292,7 +292,6 @@ tasks.withType(AsciidoctorTask).all {
test {
include '**/**'
exclude '**/HQLTest**'
}
// resources inherently exclude sources

View File

@ -9,7 +9,6 @@ package org.hibernate.metamodel.mapping.internal;
import java.util.LinkedHashMap;
import java.util.Map;
import org.hibernate.metamodel.mapping.EntityDiscriminatorMapping;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.persister.entity.DiscriminatorType;
import org.hibernate.persister.entity.JoinedSubclassEntityPersister;
@ -78,7 +77,7 @@ public class CaseStatementDiscriminatorMappingImpl extends AbstractDiscriminator
SqlAstCreationState creationState) {
final SqlExpressionResolver expressionResolver = creationState.getSqlExpressionResolver();
return expressionResolver.resolveSqlExpression(
createColumnReferenceKey( tableGroup.getGroupAlias(), EntityDiscriminatorMapping.ROLE_NAME ),
createColumnReferenceKey( tableGroup.getPrimaryTableReference(), getSelectionExpression() ),
sqlAstProcessingState -> createCaseSearchedExpression( tableGroup )
);
}
@ -87,13 +86,7 @@ public class CaseStatementDiscriminatorMappingImpl extends AbstractDiscriminator
final CaseSearchedExpression caseSearchedExpression = new CaseSearchedExpression( this );
tableDiscriminatorDetailsMap.forEach( (tableName, tableDiscriminatorDetails) -> {
TableReference tableReference;
try {
tableReference = entityTableGroup.resolveTableReference( entityTableGroup.getNavigablePath(), tableName );
}
catch (Exception e) {
tableReference = null;
}
final TableReference tableReference = entityTableGroup.getTableReference( entityTableGroup.getNavigablePath(), tableName );
if ( tableReference == null ) {
// assume this is because it is a table that is not part of the processing entity's sub-hierarchy
@ -142,10 +135,9 @@ public class CaseStatementDiscriminatorMappingImpl extends AbstractDiscriminator
@Override
public String getSelectionExpression() {
throw new UnsupportedOperationException();
// // this *should* only be used to create the sql-expression key, so just
// // using the ROLE_NAME should be fine
// return ROLE_NAME;
// this *should* only be used to create the sql-expression key, so just
// using the ROLE_NAME should be fine
return ROLE_NAME;
}

View File

@ -54,14 +54,13 @@ public class ExplicitColumnDiscriminatorMappingImpl extends AbstractDiscriminato
TableGroup tableGroup,
SqlAstCreationState creationState) {
final SqlExpressionResolver expressionResolver = creationState.getSqlExpressionResolver();
final TableReference tableReference = tableGroup.resolveTableReference( navigablePath, tableExpression );
final String selectionExpression = getSelectionExpression();
return expressionResolver.resolveSqlExpression(
createColumnReferenceKey( tableReference, EntityDiscriminatorMapping.ROLE_NAME ),
createColumnReferenceKey( tableReference, selectionExpression ),
sqlAstProcessingState -> new ColumnReference(
tableReference,
columnFormula == null ? columnName : columnFormula,
selectionExpression,
columnFormula != null,
null,
null,