Skip to content

Commit

Permalink
Remove Hibernate substitutions and deprecated properties usage
Browse files Browse the repository at this point in the history
This commit raises the baseline to Hibernate 6.5 for native support,
which allows to remove remaining Hibernate substitutions as well as
deprecated properties usage.

Closes spring-projectsgh-32314
  • Loading branch information
sdeleuze committed Apr 30, 2024
1 parent dfc053a commit 2350c8a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 137 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,7 +24,6 @@
import jakarta.persistence.spi.PersistenceUnitInfo;
import org.hibernate.bytecode.enhance.spi.EnhancementContext;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.jpa.HibernatePersistenceProvider;
import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl;
import org.hibernate.jpa.boot.internal.PersistenceUnitInfoDescriptor;
Expand All @@ -43,16 +42,8 @@
* @since 4.1
* @see Configuration#addPackage
*/
@SuppressWarnings("removal") // for Environment properties on Hibernate 6.2
class SpringHibernateJpaPersistenceProvider extends HibernatePersistenceProvider {

static {
if (NativeDetector.inNativeImage()) {
System.setProperty(Environment.BYTECODE_PROVIDER, Environment.BYTECODE_PROVIDER_NAME_NONE);
System.setProperty(Environment.USE_REFLECTION_OPTIMIZER, Boolean.FALSE.toString());
}
}

@Override
@SuppressWarnings({"rawtypes", "unchecked"}) // on Hibernate 6
public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map properties) {
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 2350c8a

Please sign in to comment.