diff --git a/eperusteet/eperusteet-service/pom.xml b/eperusteet/eperusteet-service/pom.xml
index 817399e792..0d1819904d 100644
--- a/eperusteet/eperusteet-service/pom.xml
+++ b/eperusteet/eperusteet-service/pom.xml
@@ -6,7 +6,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.7.18
+ 3.3.5
@@ -15,7 +15,6 @@
UTF-8
- 5.3.6.Final
5.7.11
2.4.3
42.5.5
@@ -31,7 +30,7 @@
9.22.3
2.9
CREATE
- 5.3.6.Final
+ 6.6.2.Final
1.15.3
1.18.34
3.10.1
@@ -85,6 +84,11 @@
+
+ org.springframework.boot
+ spring-boot-properties-migrator
+ runtime
+
io.springfox
springfox-swagger2
@@ -157,12 +161,12 @@
jackson-dataformat-toml
${jackson.version}
-
- javax.servlet
- javax.servlet-api
- 3.1.0
- provided
-
+
+
+
+
+
+
org.springframework.security
spring-security-test
@@ -180,17 +184,28 @@
31.1-jre
- org.hibernate
+ org.hibernate.orm
hibernate-jcache
+
org.ehcache
ehcache
- org.hibernate
+ org.hibernate.orm
hibernate-envers
- 5.6.14.Final
+
+
+
+ com.vladmihalcea
+ hibernate-types-60
+ 2.21.1
+
+
+ jakarta.servlet
+ jakarta.servlet-api
+ 6.1.0
javax.transaction
@@ -500,9 +515,9 @@
true
- org.hibernate
+ org.hibernate.orm
hibernate-jpamodelgen
- ${hibernate.jpamodel.version}
+ ${hibernate.version}
javax.xml.bind
diff --git a/eperusteet/eperusteet-service/src/main/java/fi/vm/sade/eperusteet/config/DefaultConfigs.java b/eperusteet/eperusteet-service/src/main/java/fi/vm/sade/eperusteet/config/DefaultConfigs.java
index 8ab263054b..ec7f53c8a2 100644
--- a/eperusteet/eperusteet-service/src/main/java/fi/vm/sade/eperusteet/config/DefaultConfigs.java
+++ b/eperusteet/eperusteet-service/src/main/java/fi/vm/sade/eperusteet/config/DefaultConfigs.java
@@ -3,8 +3,8 @@
import fi.vm.sade.eperusteet.hibernate.HibernateInterceptor;
import fi.vm.sade.eperusteet.repository.version.JpaWithVersioningRepositoryFactoryBean;
import fi.vm.sade.eperusteet.service.security.PermissionEvaluator;
+import jakarta.persistence.EntityManager;
import org.flywaydb.core.Flyway;
-import org.hibernate.jpa.HibernateEntityManager;
import org.hibernate.jpa.HibernatePersistenceProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.EnableCaching;
@@ -12,13 +12,11 @@
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Profile;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.ResourceBundleMessageSource;
import org.springframework.core.task.TaskExecutor;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
-import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.scheduling.annotation.EnableAsync;
@@ -109,14 +107,14 @@ public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
entityManagerFactory.setDataSource(dataSource);
entityManagerFactory.setPackagesToScan("fi.vm.sade.eperusteet.domain");
entityManagerFactory.setPersistenceProviderClass(HibernatePersistenceProvider.class);
- entityManagerFactory.setEntityManagerInterface(HibernateEntityManager.class);
+ entityManagerFactory.setEntityManagerInterface(EntityManager.class);
Map props = new HashMap<>();
props.put("hibernate.hbm2ddl.auto", "validate");
props.put("hibernate.show_sql", false);
props.put("hibernate.dialect", "fi.vm.sade.eperusteet.utils.repository.dialect.CustomPostgreSqlDialect");
- props.put("javax.persistence.sharedCache.mode", "ENABLE_SELECTIVE");
+ props.put("jakarta.persistence.sharedCache.mode", "ENABLE_SELECTIVE");
props.put("org.hibernate.envers.audit_strategy", "org.hibernate.envers.strategy.internal.DefaultAuditStrategy");
- props.put("javax.persistence.validation.factory", validator());
+ props.put("jakarta.persistence.validation.factory", validator());
props.put("org.hibernate.envers.revision_listener", "fi.vm.sade.eperusteet.service.impl.AuditRevisionListener");
props.put("hibernate.jdbc.batch_size", 20);
props.put("hibernate.jdbc.fetch_size", 20);
diff --git a/eperusteet/eperusteet-service/src/main/java/fi/vm/sade/eperusteet/config/ExceptionHandlingConfig.java b/eperusteet/eperusteet-service/src/main/java/fi/vm/sade/eperusteet/config/ExceptionHandlingConfig.java
index e292ca9ec7..058a31102d 100644
--- a/eperusteet/eperusteet-service/src/main/java/fi/vm/sade/eperusteet/config/ExceptionHandlingConfig.java
+++ b/eperusteet/eperusteet-service/src/main/java/fi/vm/sade/eperusteet/config/ExceptionHandlingConfig.java
@@ -20,9 +20,11 @@
import org.springframework.core.NestedRuntimeException;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
+import org.springframework.http.HttpStatusCode;
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.http.converter.HttpMessageNotWritableException;
+import org.springframework.lang.Nullable;
import org.springframework.transaction.TransactionSystemException;
import org.springframework.validation.BindException;
import org.springframework.web.HttpMediaTypeNotAcceptableException;
@@ -38,12 +40,12 @@
import org.springframework.web.multipart.support.MissingServletRequestPartException;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
-import javax.persistence.PersistenceException;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.validation.ConstraintViolation;
-import javax.validation.ConstraintViolationException;
-import javax.validation.ValidationException;
+import jakarta.persistence.PersistenceException;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.validation.ConstraintViolation;
+import jakarta.validation.ConstraintViolationException;
+import jakarta.validation.ValidationException;
import java.io.IOException;
import java.security.Principal;
import java.util.ArrayList;
@@ -71,8 +73,7 @@ public ResponseEntity