Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/maven/hibernate.version-6.4.1.Final
Browse files Browse the repository at this point in the history
  • Loading branch information
jandroav authored Jan 5, 2024
2 parents f942e7d + a363db4 commit 31a6115
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/attach-artifact-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ on:
jobs:

attach-artifact-to-release:
uses: liquibase/build-logic/.github/workflows/extension-attach-artifact-release.yml@v0.5.9
uses: liquibase/build-logic/.github/workflows/extension-attach-artifact-release.yml@v0.6.0
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/build-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
nightly-build:
uses: liquibase/build-logic/.github/workflows/os-extension-test.yml@v0.5.9
uses: liquibase/build-logic/.github/workflows/os-extension-test.yml@v0.6.0
with:
nightly: true
java: '[17, 21]'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ permissions:

jobs:
create-release:
uses: liquibase/build-logic/.github/workflows/create-release.yml@v0.5.9
uses: liquibase/build-logic/.github/workflows/create-release.yml@v0.6.0
secrets: inherit
12 changes: 10 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,16 @@ permissions:
pull-requests: write

jobs:

authorize:
environment: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true

build-test:
uses: liquibase/build-logic/.github/workflows/[email protected]
needs: authorize
uses: liquibase/build-logic/.github/workflows/[email protected]
secrets: inherit
with:
java: '[17, 21]'
Expand Down Expand Up @@ -60,5 +68,5 @@ jobs:
dependabot:
needs: hibernate-test
uses: liquibase/build-logic/.github/workflows/dependabot-automerge.yml@v0.5.9
uses: liquibase/build-logic/.github/workflows/dependabot-automerge.yml@v0.6.0
secrets: inherit
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected void configureSources(MetadataSources sources) throws DatabaseExceptio
Configuration config = new Configuration(sources);
config.configure(getHibernateConnection().getPath());

config.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false");
config.setProperty(HibernateDatabase.HIBERNATE_TEMP_USE_JDBC_METADATA_DEFAULTS, Boolean.FALSE.toString());
config.setProperty("hibernate.cache.use_second_level_cache", "false");

ServiceRegistry standardRegistry = configuration.getStandardServiceRegistryBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public abstract class HibernateDatabase extends AbstractJdbcDatabase {

private boolean indexesForForeignKeys = false;
public static final String DEFAULT_SCHEMA = "HIBERNATE";
public static final String HIBERNATE_TEMP_USE_JDBC_METADATA_DEFAULTS = "hibernate.temp.use_jdbc_metadata_defaults";

public HibernateDatabase() {
setDefaultCatalogName(DEFAULT_SCHEMA);
Expand Down Expand Up @@ -186,6 +187,7 @@ protected MetadataSources createMetadataSources() throws DatabaseException {

ServiceRegistry standardRegistry = new StandardServiceRegistryBuilder()
.applySetting(AvailableSettings.DIALECT, dialect)
.applySetting(HibernateDatabase.HIBERNATE_TEMP_USE_JDBC_METADATA_DEFAULTS, Boolean.FALSE.toString())
.addService(ConnectionProvider.class, new NoOpConnectionProvider())
.addService(MultiTenantConnectionProvider.class, new NoOpConnectionProvider())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ protected EntityManagerFactoryBuilderImpl createEntityManagerFactoryBuilder() {
MyHibernatePersistenceProvider persistenceProvider = new MyHibernatePersistenceProvider();

Map<String, Object> properties = new HashMap<>();
properties.put(HibernateDatabase.HIBERNATE_TEMP_USE_JDBC_METADATA_DEFAULTS, Boolean.FALSE.toString());
properties.put(AvailableSettings.USE_SECOND_LEVEL_CACHE, Boolean.FALSE.toString());
properties.put(AvailableSettings.USE_NATIONALIZED_CHARACTER_DATA, getProperty(AvailableSettings.USE_NATIONALIZED_CHARACTER_DATA));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ protected EntityManagerFactoryBuilderImpl createEntityManagerFactoryBuilder() {

Map<String, String> map = new HashMap<>();
map.put(AvailableSettings.DIALECT, getProperty(AvailableSettings.DIALECT));
map.put(HibernateDatabase.HIBERNATE_TEMP_USE_JDBC_METADATA_DEFAULTS, Boolean.FALSE.toString());
map.put(AvailableSettings.USE_SECOND_LEVEL_CACHE, Boolean.FALSE.toString());
map.put(AvailableSettings.PHYSICAL_NAMING_STRATEGY, getHibernateConnection().getProperties().getProperty(AvailableSettings.PHYSICAL_NAMING_STRATEGY));
map.put(AvailableSettings.IMPLICIT_NAMING_STRATEGY, getHibernateConnection().getProperties().getProperty(AvailableSettings.IMPLICIT_NAMING_STRATEGY));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package liquibase.ext.hibernate.database;

import java.util.Collections;
import java.util.Map;

import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl;
import org.hibernate.jpa.boot.spi.Bootstrap;
Expand Down Expand Up @@ -50,7 +50,8 @@ protected EntityManagerFactoryBuilderImpl createEntityManagerFactoryBuilder() {
internalPersistenceUnitManager.preparePersistenceUnitInfos();
PersistenceUnitInfo persistenceUnitInfo = internalPersistenceUnitManager.obtainDefaultPersistenceUnitInfo();

EntityManagerFactoryBuilderImpl builder = (EntityManagerFactoryBuilderImpl) Bootstrap.getEntityManagerFactoryBuilder(persistenceUnitInfo, Collections.emptyMap());
EntityManagerFactoryBuilderImpl builder = (EntityManagerFactoryBuilderImpl) Bootstrap.getEntityManagerFactoryBuilder(persistenceUnitInfo, Map.of(
HibernateDatabase.HIBERNATE_TEMP_USE_JDBC_METADATA_DEFAULTS, Boolean.FALSE.toString()));
return builder;
}

Expand Down

0 comments on commit 31a6115

Please sign in to comment.