diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 1ec4d5a..99b2d28 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -13,5 +13,5 @@ jobs: call-workflow: uses: 42BV/42-github-workflows/.github/workflows/maven-test.yml@main with: - java-version: 17 + java-version: 21 secrets: inherit diff --git a/pom.xml b/pom.xml index c7f37b3..e30e558 100644 --- a/pom.xml +++ b/pom.xml @@ -54,19 +54,19 @@ UTF-8 6.0.0 - 3.17.0 + 3.18.0 6.0.1 4.0.2 33.3.1-jre 6.4.4.Final 8.0.1.Final 2.7.4 - 2.18.1 - 2.18.1 - 3.1.0 - 3.1.0 + 2.19.2 + 2.19.2 + 3.2.0 + 3.1.1 6.1.0 - 5.14.2 + 5.18.0 2.9.0 5.11.3 5.11.3 @@ -74,10 +74,13 @@ 3.0.0 2.0.16 6.2.0 - 3.4.0 - 6.4.1 - 3.4.0 - 3.2.7 + 3.5.3 + 6.5.2 + 3.5.2 + 3.2.8 + 3.5.3 + 0.8.13 + 0.8.0 @@ -277,7 +280,7 @@ maven-surefire-plugin - 3.5.2 + ${maven-surefire-plugin.version} @@ -294,7 +297,7 @@ org.sonatype.central central-publishing-maven-plugin - 0.7.0 + ${central-publishing-maven-plugin.version} true central @@ -347,7 +350,7 @@ org.jacoco jacoco-maven-plugin - 0.8.12 + ${jacoco-maven-plugin.version} diff --git a/src/test/java/io/beanmapper/spring/ApplicationConfig.java b/src/test/java/io/beanmapper/spring/ApplicationConfig.java index 7d7803d..bc39f72 100644 --- a/src/test/java/io/beanmapper/spring/ApplicationConfig.java +++ b/src/test/java/io/beanmapper/spring/ApplicationConfig.java @@ -4,7 +4,7 @@ package io.beanmapper.spring; import com.fasterxml.jackson.databind.ObjectMapper; -import org.hibernate.cfg.ImprovedNamingStrategy; + import org.hibernate.dialect.HSQLDialect; import org.hibernate.jpa.HibernatePersistenceProvider; import org.springframework.beans.factory.annotation.Autowired; @@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.RestController; +import jakarta.persistence.EntityManagerFactory; import javax.sql.DataSource; import java.util.HashMap; import java.util.Map; @@ -56,19 +57,24 @@ public LocalContainerEntityManagerFactoryBean entityManagerFactory() { jpaVendorAdapter.setGenerateDdl(false); jpaVendorAdapter.setDatabasePlatform(hibernateDialect); entityManagerFactoryBean.setJpaVendorAdapter(jpaVendorAdapter); - - Map jpaProperties = new HashMap(); - jpaProperties.put("hibernate.ejb.naming_strategy", ImprovedNamingStrategy.class.getName()); + + Map jpaProperties = getHibernatePropertyMap(); + entityManagerFactoryBean.setJpaPropertyMap(jpaProperties); + entityManagerFactoryBean.setEntityManagerFactoryInterface(EntityManagerFactory.class); + + return entityManagerFactoryBean; + } + + private Map getHibernatePropertyMap() { + Map jpaProperties = new HashMap<>(); jpaProperties.put("hibernate.dialect", hibernateDialect); jpaProperties.put("hibernate.hbm2ddl.auto", "create-drop"); jpaProperties.put("hibernate.jdbc.use_get_generated_keys", true); jpaProperties.put("hibernate.id.new_generator_mappings", true); jpaProperties.put("hibernate.generate_statistics", false); - - entityManagerFactoryBean.setJpaPropertyMap(jpaProperties); - return entityManagerFactoryBean; + return jpaProperties; } - + @Bean public JpaTransactionManager transactionManager(@Autowired LocalContainerEntityManagerFactoryBean entityManagerFactory) { JpaTransactionManager transactionManager = new JpaTransactionManager();