diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index fa8e7c3f9..fc0679156 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -82,7 +82,8 @@ jobs:
- name: Build with Maven
env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_USERNAME: ${{ secrets.GITHUB_USERNAME }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd eperusteet-ylops-service
mvn clean verify --batch-mode -Pit
diff --git a/Justfile b/Justfile
index 7dd68be83..1cd556afb 100644
--- a/Justfile
+++ b/Justfile
@@ -1,11 +1,11 @@
# Generoi openapi-kuvaukset
gen_openapi:
@cd eperusteet-ylops-service/ \
- && mvn clean compile -P generate-openapi \
+ && mvn clean verify -Pspringdoc \
&& cp target/openapi/ylops.spec.json ../generated
# Generoi julkiset openapi-kuvaukset
gen_openapi_ext:
@cd eperusteet-ylops-service/ \
- && mvn clean compile -P generate-openapi-ext \
+ && mvn clean verify -Pspringdoc-ext \
&& cp target/openapi/ylops-ext.spec.json ../generated
diff --git a/eperusteet-ylops-service/pom.xml b/eperusteet-ylops-service/pom.xml
index 1da7282e2..856b7885a 100644
--- a/eperusteet-ylops-service/pom.xml
+++ b/eperusteet-ylops-service/pom.xml
@@ -1,963 +1,42 @@
4.0.0
+
- org.springframework.boot
- spring-boot-starter-parent
- 2.7.18
+ fi.vm.sade.eperusteet
+ eperusteet-parent-pom
+ 1.0.4
- eperusteet-ylops-service
+
eperusteet-ylops-service
+ eperusteet-service
+ 3.0.0
+
- 4.5.13
- 1.13
- true
- jdbc:postgresql://localhost:5432/${eperusteet-ylops.devdb.user}
- jdbc:postgresql://localhost:5432/${eperusteet-ylops.ittestdb.user}
- 2.5
- fi.vm.sade.eperusteet.ylops.resource
- 3.2.2
- 9.22.3
- 2.9
- CREATE
- 5.3.6.Final
- 2.15.4
- 11
- 1.15.3
- 1.18.34
- 3.10.1
- 17
- 17
- 4.2.18
- 9.0.90
- 2.0.29
- 42.5.5
- UTF-8
- 0.6.1-SNAPSHOT
- ${project.basedir}/target/schema.ddl
- 5.7.11
- 2.4.3
- 2.7.0
- 3.2.2
- 3.1.7
- 0.8.12
+ http://localhost:8081/eperusteet-ylops-service/api-docs
+ ylops.spec.json
+ http://localhost:8081/eperusteet-ylops-service/api-docs/external
+ ylops-ext.spec.json
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
-
- org.springframework.boot
- spring-boot-starter-security
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- org.springframework.boot
- spring-boot-starter-cache
-
-
- org.springframework.boot
- spring-boot-starter-validation
-
-
- org.springframework.boot
- spring-boot-starter
-
-
- org.springframework.boot
- spring-boot-starter-logging
-
-
-
-
- org.apache.tomcat.embed
- tomcat-embed-core
- ${org.apache.tomcat.version}
-
-
- org.apache.tomcat.embed
- tomcat-embed-el
- ${org.apache.tomcat.version}
-
-
- org.apache.tomcat.embed
- tomcat-embed-websocket
- ${org.apache.tomcat.version}
-
-
- one.util
- streamex
- 0.6.5
-
-
- junit
- junit
- 4.12
- test
-
-
- org.flywaydb
- flyway-core
- ${flyway.version}
-
-
- org.apache.httpcomponents
- httpclient
- ${apache.httpclient.version}
-
-
- commons-httpclient
- commons-httpclient
- 3.1
-
-
- org.apache.httpcomponents
- httpclient-cache
- ${apache.httpclient.version}
-
-
- com.google.code.gson
- gson
- 2.8.9
-
-
- org.assertj
- assertj-core
- 3.24.2
- test
-
-
- com.fasterxml.jackson.datatype
- jackson-datatype-joda
- ${jackson.version}
-
-
- com.fasterxml.jackson.dataformat
- jackson-dataformat-toml
- ${jackson.version}
-
-
- javax.servlet
- javax.servlet-api
- 3.1.0
- provided
-
-
- org.springframework.security
- spring-security-test
- ${spring.security.test.version}
- test
-
-
- org.springframework.session
- spring-session-jdbc
- ${spring.session.jdbc.version}
-
-
- com.google.guava
- guava
- 31.1-jre
-
-
- org.hibernate
- hibernate-jcache
-
-
- org.ehcache
- ehcache
-
-
- org.hibernate
- hibernate-envers
- 5.6.14.Final
-
-
- javax.transaction
- jta
- 1.1
-
-
- jakarta.activation
- jakarta.activation-api
- 1.2.2
-
-
- com.sun.activation
- jakarta.activation
- 2.0.1
-
-
- javax.el
- javax.el-api
- 3.0.0
- test
-
-
- org.glassfish
- javax.el
- 3.0.0
- test
-
-
- com.zaxxer
- HikariCP
- 5.0.1
-
-
- org.postgresql
- postgresql
- ${postgresql.version}
-
-
- commons-dbcp
- commons-dbcp
- 1.4
- test
-
-
- org.springframework
- spring-test
- test
-
-
- com.h2database
- h2
- 1.4.192
- test
-
-
- org.mockito
- mockito-core
- 2.28.2
-
-
- org.jeasy
- easy-random
- 4.1.0
- pom
-
-
- ma.glasnost.orika
- orika-core
- 1.5.4
-
-
- org.projectlombok
- lombok
- ${lombok.version}
- provided
-
-
- fi.vm.sade.java-utils
- opintopolku-user-details-service
- 0.4.0-SNAPSHOT
-
-
- fi.vm.sade.java-utils
- java-properties
- 0.1.0-SNAPSHOT
-
-
- fi.vm.sade.java-utils
- java-http
- 0.6.1-SNAPSHOT
-
-
- fi.vm.sade.java-utils
- opintopolku-cas-servlet-filter
- 0.2.0-SNAPSHOT
-
-
- fi.vm.sade
- auditlogger
- 8.3.1-SNAPSHOT
-
-
- org.jsoup
- jsoup
- ${jsoup.version}
-
-
- io.springfox
- springfox-swagger2
- ${springfox.version}
-
-
- org.aspectj
- aspectjtools
- 1.9.22.1
-
-
- org.jasig.cas.client
- cas-client-support-distributed-ehcache
- 3.6.4
-
-
- net.sf.ehcache
- ehcache-core
-
-
-
-
- xml-apis
- xml-apis
- 1.4.01
-
-
- org.apache.xmlgraphics
- fop
- ${fop.version}
-
-
- servlet-api
- javax.servlet
-
-
-
-
- org.apache.pdfbox
- pdfbox
- ${pdfbox.version}
-
-
- org.apache.pdfbox
- fontbox
- ${pdfbox.version}
-
-
- org.apache.pdfbox
- preflight
- ${pdfbox.version}
-
-
- org.apache.xmlgraphics
- batik-i18n
- ${batik.version}
-
-
- org.apache.xmlgraphics
- batik-constants
- ${batik.version}
-
-
- org.apache.tika
- tika-core
- 2.7.0
-
-
- fi.ratamaa
- dtoconverter
- 2.0.3-RELEASE
-
-
- org.hibernate.javax.persistence
- hibernate-jpa-2.0-api
-
-
- javax.validation
- validation-api
-
-
- javassist
- javassist
-
-
-
-
- fi.vm.sade.eperusteet
- eperusteet-backend-utils
- ${eperusteet.backend-utils.version}
-
-
- commons-collections
- commons-collections
- 3.2.2
-
-
- org.apache.commons
- commons-lang3
- 3.9
-
-
- commons-validator
- commons-validator
- 1.7
-
-
- commons-io
- commons-io
- 2.7
-
-
- org.skyscreamer
- jsonassert
- 1.5.1
-
-
- org.apache.commons
- commons-text
- 1.10.0
-
-
- javax.xml.bind
- jaxb-api
- 2.3.1
-
-
- javax.annotation
- javax.annotation-api
- 1.3.2
-
-
- org.junit.vintage
- junit-vintage-engine
- test
-
-
- org.yaml
- snakeyaml
- 2.2
-
-
- ch.qos.logback
- logback-access
- 1.2.13
-
-
- ch.qos.logback
- logback-classic
- 1.2.13
-
-
- ch.qos.logback
- logback-core
- 1.2.13
-
-
- com.codepoetics
- protonpack
- 1.10
-
-
- com.ryantenney.metrics
- metrics-spring
- 3.1.3
-
-
- io.dropwizard.metrics
- metrics-core
- ${metrics.version}
-
-
- io.dropwizard.metrics
- metrics-servlets
- ${metrics.version}
-
-
- io.dropwizard.metrics
- metrics-jmx
- ${metrics.version}
-
-
- org.jacoco
- jacoco-maven-plugin
- ${jacoco.version}
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
- -Dfile.encoding=UTF8
- --add-opens=java.base/java.lang=ALL-UNNAMED
-
-
-
-
-
- org.apache.maven.plugins
- maven-resources-plugin
-
-
- ttf
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- ${maven-compiler-plugin.version}
-
-
- ${maven.compiler.target}
- true
-
-
- org.hibernate
- hibernate-jpamodelgen
- ${hibernate.jpamodel.version}
-
-
- javax.xml.bind
- jaxb-api
- 2.3.0
-
-
- javax.annotation
- javax.annotation-api
- 1.3.1
-
-
- org.projectlombok
- lombok
- ${lombok.version}
-
-
-
- --add-modules
- java.datatransfer,java.desktop,java.xml
-
-
-
-
- org.apache.maven.plugins
- maven-failsafe-plugin
- ${failsafe.version}
-
-
-
- integration-test
- verify
-
-
-
-
-
- --add-opens=java.base/java.lang=ALL-UNNAMED
-
-
- **/ylops/test/**.java
-
-
- **/*IT.java
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- ${surefire.version}
-
-
- --add-opens=java.base/java.lang=ALL-UNNAMED
-
-
- **/ylops/test/**.java
- **/*IT.java
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 2.10.4
-
- true
- -Xdoclint:none
- ${project.basedir}/src/main/java;${project.basedir}/target/generated-sources/annotations
-
- db/migration/**
- **/domain/**/*_.java
- com/google/code/**
-
-
-
-
- io.snyk
- snyk-maven-plugin
- 2.0.0
- false
-
-
- snyk-test
-
- test
-
-
-
- snyk-monitor
-
- monitor
-
-
-
-
- 568d706d-f3f8-4657-a2b1-4449167c05c0
-
- --all-projects
-
-
-
-
- io.snyk
- snyk-maven-plugin
- 2.0.0
- false
-
-
- --all-projects
-
-
-
-
- org.jacoco
- jacoco-maven-plugin
- ${jacoco.version}
-
-
- pre-unit-test
-
- prepare-agent
-
-
- ${project.build.directory}/jacoco-ut.exec
- surefireArgLine
-
-
-
- pre-integration-test
- pre-integration-test
-
- prepare-agent
-
-
- ${project.build.directory}/jacoco-it.exec
- failsafeArgLine
-
-
-
- report
- test
-
- report
-
-
- ${project.build.directory}/jacoco.exec
- ${project.build.directory}/jacoco
-
- XML
- HTML
-
-
-
-
- merge-files
- post-integration-test
-
- merge
-
-
-
-
- ${project.build.directory}
-
- *.exec
-
-
-
- ${project.build.directory}/jacoco.exec
-
-
-
- post-integration-test
- post-integration-test
-
- report
-
-
- ${project.build.directory}/jacoco.exec
- ${project.build.directory}/jacoco
-
- XML
- HTML
-
-
-
-
-
-
-
-
-
- de.juplo
- hibernate4-maven-plugin
- 1.1.1
-
-
-
- export
-
-
-
-
- true
- ${hibernate.export.type}
- SCRIPT
- org.postgresql.Driver
- fi.vm.sade.eperusteet.utils.repository.dialect.CustomPostgreSqlDialect
-
-
-
- ${project.basedir}/src/test/config/hibernate.properties
- ${project.basedir}/src/main/resources/hibernate-typedefs.hbm.xml
- ${schema.file}
- NONE
-
-
-
- org.postgresql
- postgresql
- ${postgresql.version}
-
-
- fi.vm.sade.eperusteet
- eperusteet-backend-utils
- 2.4-SNAPSHOT
-
-
- javax.xml.bind
- jaxb-api
- 2.3.1
-
-
-
-
-
eperusteet-ylops-service
-
-
- generate-openapi
-
-
-
- com.github.kongchen
- swagger-maven-plugin
- ${swagger-maven-plugin-version}
-
-
-
- true
-
- http
- https
-
-
- ${eperusteet.resources}.dokumentti.*
- ${eperusteet.resources}.external.*
- ${eperusteet.resources}.julkinen.*
- ${eperusteet.resources}.kommentointi.KommentointiController
- ${eperusteet.resources}.lops2019.Lops2019Controller
- ${eperusteet.resources}.lops2019.Lops2019Controller
- ${eperusteet.resources}.lops2019.Lops2019Controller
- ${eperusteet.resources}.lops2019.Lops2019OpintojaksoController
- ${eperusteet.resources}.lops2019.Lops2019OpintojaksoController
- ${eperusteet.resources}.lops2019.Lops2019OppiaineController
- ${eperusteet.resources}.lops2019.Lops2019OppiaineController
- ${eperusteet.resources}.lops2019.Lops2019PerusteController
- ${eperusteet.resources}.lops2019.Lops2019PerusteController
- ${eperusteet.resources}.ohje.*
- ${eperusteet.resources}.ops.JulkaisuController
- ${eperusteet.resources}.ops.KommenttiController
- ${eperusteet.resources}.ops.LiitetiedostoController
- ${eperusteet.resources}.ops.OpetussuunnitelmaController
- ${eperusteet.resources}.ops.OpetussuunnitelmaJulkisetController
- ${eperusteet.resources}.ops.OpetussuunnitelmanAikatauluController
- ${eperusteet.resources}.ops.OpetussuunnitelmanMuokkausietoController
- ${eperusteet.resources}.ops.OpetussuunnitelmanSisaltoController
- ${eperusteet.resources}.ops.OppiaineController
- ${eperusteet.resources}.ops.OppiaineenVuosiluokkaController
- ${eperusteet.resources}.ops.OppiaineenVuosiluokkakokonaisuusController
- ${eperusteet.resources}.ops.TermistoController
- ${eperusteet.resources}.ops.VuosiluokkakokonaisuusController
- ${eperusteet.resources}.ops.lukio.LukioOpetussuunnitelmatController
- ${eperusteet.resources}.ukk.*
- ${eperusteet.resources}.util.KayttajaController
-
- /substitutes.map
-
- ePerusteet lukio api
- v1
-
- ylops.spec
- target/openapi
-
-
-
-
-
- compile
-
- generate
-
-
-
-
-
-
-
-
- generate-openapi-ext
-
-
-
- com.github.kongchen
- swagger-maven-plugin
- ${swagger-maven-plugin-version}
-
-
-
- true
-
- https
-
-
- virkailija.opintopolku.fi
- /eperusteet-ylops-service
-
-
- ${eperusteet.resources}.julkinen.ExternalController
-
- /substitutes.map
-
- OPS-työkalu API
- 1
- Yleissivistävien opetussuunnitelmien rajapintakuvaukset
-
- ylops-ext.spec
- target/openapi
-
-
-
-
-
- compile
-
- generate
-
-
-
-
-
-
-
-
- generate-db-diagram
-
-
-
- de.juplo
- hibernate4-maven-plugin
-
-
-
- export
-
- process-classes
-
-
-
- ${project.basedir}/src/test/config/hibernate-typedefs.xml
-
-
-
-
-
-
- it
-
-
-
- org.apache.maven.plugins
- maven-failsafe-plugin
- ${failsafe.version}
-
-
- -Dlog4j2.level=OFF
- -Xmx2048m
- -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${project.build.directory}/jacoco-it.exec
- --add-opens=java.base/java.lang=ALL-UNNAMED
-
-
- **/ylops/test/**.java
-
-
- **/*IT.java
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- ${surefire.version}
-
-
- -Dlog4j2.level=OFF
- -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${project.build.directory}/jacoco-ut.exec
- --add-opens=java.base/java.lang=ALL-UNNAMED
-
-
- **/ylops/test/**.java
- **/*IT.java
-
-
-
-
-
-
-
- oph-sade-artifactory
- oph-sade-artifactory-releases
- https://artifactory.opintopolku.fi/artifactory/oph-sade-release-local
+ github
+ GitHub Packages
+ https://maven.pkg.github.com/Opetushallitus/eperusteet-ylops
-
- oph-sade-artifactory
- oph-sade-artifactory-snapshots
- https://artifactory.opintopolku.fi/artifactory/oph-sade-snapshot-local
-
- oph-sade-artifactory-snapshots
- https://artifactory.opintopolku.fi/artifactory/oph-sade-snapshot-local
-
- true
-
-
- false
-
-
-
- oph-sade-artifactory-releases
- https://artifactory.opintopolku.fi/artifactory/oph-sade-release-local
+ github
+ GitHub Packages
+ https://maven.pkg.github.com/Opetushallitus/eperusteet-backend-utils
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/DefaultConfigs.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/DefaultConfigs.java
index b1a4b395e..6aa47cb48 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/DefaultConfigs.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/DefaultConfigs.java
@@ -2,11 +2,14 @@
import fi.vm.sade.eperusteet.ylops.repository.version.JpaWithVersioningRepositoryFactoryBean;
import fi.vm.sade.eperusteet.ylops.service.security.PermissionEvaluator;
+import jakarta.persistence.EntityManager;
import org.flywaydb.core.Flyway;
-import org.hibernate.jpa.HibernateEntityManager;
+import org.hibernate.cfg.AvailableSettings;
+import org.hibernate.id.enhanced.SingleNamingStrategy;
import org.hibernate.jpa.HibernatePersistenceProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@@ -21,13 +24,14 @@
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler;
-import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.security.task.DelegatingSecurityContextAsyncTaskExecutor;
import org.springframework.transaction.annotation.EnableTransactionManagement;
-import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
import javax.sql.DataSource;
+import java.text.MessageFormat;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
@Profile("!test")
@@ -35,9 +39,9 @@
@ComponentScan({"fi.vm.sade.eperusteet.ylops.service", "fi.vm.sade.eperusteet.utils", "fi.vm.sade.eperusteet.ylops.repository.impl"})
@EnableAsync
@EnableCaching
-@EnableTransactionManagement
-@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
-@EnableAspectJAutoProxy // (proxyTargetClass = true)
+@EnableTransactionManagement(order = 0)
+@EnableMethodSecurity(securedEnabled = true)
+@EnableAspectJAutoProxy
@EnableJpaRepositories(basePackages = "fi.vm.sade.eperusteet.ylops.repository", repositoryFactoryBeanClass = JpaWithVersioningRepositoryFactoryBean.class)
@PropertySource(
ignoreResourceNotFound = true, value={
@@ -50,7 +54,7 @@ public class DefaultConfigs {
private DataSource dataSource;
@Bean
- public TaskExecutor defaultExecutor() {
+ public TaskExecutor taskExecutor() {
final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(2);
executor.setMaxPoolSize(10);
@@ -72,11 +76,6 @@ public DefaultMethodSecurityExpressionHandler expressionHandler() {
return expressionHandler;
}
- @Bean
- public LocalValidatorFactoryBean validator() {
- return new LocalValidatorFactoryBean();
- }
-
@Bean(initMethod = "migrate")
public Flyway flyway() {
return Flyway.configure()
@@ -87,11 +86,13 @@ public Flyway flyway() {
}
@Bean
- public ResourceBundleMessageSource messageSource() {
- ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
- messageSource.setDefaultEncoding("UTF-8");
- messageSource.setBasename("messages");
- return messageSource;
+ public MessageSource messageSource() {
+ return new ResourceBundleMessageSource() {
+ @Override
+ protected MessageFormat resolveCode(String code, Locale locale) {
+ return null; // Disable message resolution
+ }
+ };
}
@Bean
@@ -101,20 +102,18 @@ public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
entityManagerFactory.setDataSource(dataSource);
entityManagerFactory.setPackagesToScan("fi.vm.sade.eperusteet.ylops.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("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect");
+ 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("org.hibernate.envers.revision_listener", "fi.vm.sade.eperusteet.ylops.service.internal.AuditRevisionListener");
props.put("hibernate.jdbc.batch_size", 20);
props.put("hibernate.jdbc.fetch_size", 20);
- props.put("hibernate.id.new_generator_mappings", false);
+ props.put(AvailableSettings.ID_DB_STRUCTURE_NAMING_STRATEGY, SingleNamingStrategy.STRATEGY_NAME);
entityManagerFactory.setJpaPropertyMap(props);
- entityManagerFactory.setMappingResources("hibernate-typedefs.hbm.xml");
return entityManagerFactory;
}
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/MetricsConfig.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/MetricsConfig.java
deleted file mode 100644
index c2e6b861b..000000000
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/MetricsConfig.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package fi.vm.sade.eperusteet.ylops.config;
-
-import com.codahale.metrics.ConsoleReporter;
-import com.codahale.metrics.MetricRegistry;
-import com.codahale.metrics.jmx.JmxReporter;
-import com.ryantenney.metrics.spring.config.annotation.EnableMetrics;
-import com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerAdapter;
-import org.springframework.context.annotation.Configuration;
-
-import java.util.concurrent.TimeUnit;
-
-@Configuration
-@EnableMetrics
-public class MetricsConfig extends MetricsConfigurerAdapter {
-
- @Override
- public void configureReporters(MetricRegistry metricRegistry) {
- registerReporter(JmxReporter
- .forRegistry(metricRegistry)
- .build()).start();
-
- registerReporter(ConsoleReporter
- .forRegistry(metricRegistry)
- .build()).start(1, TimeUnit.DAYS);
- }
-
-}
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/MvcConfiguration.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/MvcConfiguration.java
index c771a9c33..419c96f7f 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/MvcConfiguration.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/MvcConfiguration.java
@@ -8,6 +8,7 @@
import fi.vm.sade.eperusteet.ylops.resource.config.ReferenceNamingStrategy;
import fi.vm.sade.eperusteet.ylops.resource.util.CacheHeaderInterceptor;
import fi.vm.sade.eperusteet.ylops.resource.util.LoggingInterceptor;
+import jakarta.persistence.EntityManagerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -24,7 +25,6 @@
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-import javax.persistence.EntityManagerFactory;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
@@ -44,7 +44,6 @@ public void configurePathMatch(PathMatchConfigurer matcher) {
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/ui/").setViewName("forward:/ui/index.html");
registry.addRedirectViewController("/ui", "/ui/");
- registry.addRedirectViewController("/swagger", "/swagger/index.html");
}
@Override
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/SwaggerConfig.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/SwaggerConfig.java
index 43d2186a9..002c6877e 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/SwaggerConfig.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/SwaggerConfig.java
@@ -1,70 +1,77 @@
package fi.vm.sade.eperusteet.ylops.config;
-import com.fasterxml.classmate.GenericType;
-import com.fasterxml.classmate.TypeResolver;
-import com.fasterxml.jackson.databind.JsonNode;
-import fi.vm.sade.eperusteet.ylops.resource.config.InternalApi;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
+import com.fasterxml.jackson.databind.type.SimpleType;
+import io.swagger.v3.core.converter.AnnotatedType;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.info.Info;
+import io.swagger.v3.oas.models.info.License;
+import io.swagger.v3.oas.models.media.Schema;
+import io.swagger.v3.oas.models.parameters.Parameter;
+import org.springdoc.core.customizers.ParameterCustomizer;
+import org.springdoc.core.customizers.PropertyCustomizer;
+import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-import org.springframework.http.ResponseEntity;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
+import org.springframework.core.MethodParameter;
-import javax.servlet.ServletContext;
-import java.util.ArrayList;
-import java.util.Optional;
-import java.util.concurrent.Callable;
-
-import static com.google.common.base.Predicates.not;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.stream.Collectors;
@Configuration
-@EnableSwagger2
-@Profile("!test")
public class SwaggerConfig {
- private static final Logger LOG = LoggerFactory.getLogger(SwaggerConfig.class);
- @Autowired
- private TypeResolver typeResolver;
+ @Bean
+ public OpenAPI springShopOpenAPI() {
+ return new OpenAPI()
+ .info(new Info()
+ .title("ePerusteet ylops rajapinta")
+ .description("Spring MVC API based on the swagger 3.0 specification")
+ .version("v3.0.0")
+ .license(new License().name("EUPL 1.1").url("https://interoperable-europe.ec.europa.eu/licence/european-union-public-licence-version-11-or-later-eupl")));
+ }
@Bean
- public Docket swagger2Api(ServletContext ctx) {
- LOG.debug("Starting Swagger v2");
+ public PropertyCustomizer enumPropertyCustomizer() {
+ return new PropertyCustomizer() {
- return new Docket(DocumentationType.SWAGGER_2)
- .apiInfo(apiInfo())
- .directModelSubstitute(JsonNode.class, Object.class)
- .genericModelSubstitutes(ResponseEntity.class, Optional.class)
- .forCodeGeneration(true)
- .select()
- .apis(not(RequestHandlerSelectors.withClassAnnotation(InternalApi.class)))
- .build()
- .alternateTypeRules(
- springfox.documentation.schema.AlternateTypeRules.newRule(
- typeResolver.resolve(new GenericType>>() {
- }),
- typeResolver.resolve(Object.class)));
+ @Override
+ public Schema customize(Schema schema, AnnotatedType type) {
+ Type javaType = type.getType();
+ if (javaType instanceof SimpleType && ((SimpleType) javaType).isEnumType()) {
+ Class> enumClass = ((SimpleType) javaType).getRawClass();
+ schema.setEnum(Arrays.stream(enumClass.getEnumConstants())
+ .map(enumConstant -> ((Enum>) enumConstant).name())
+ .collect(Collectors.toList()));
+ }
+ return schema;
+ }
+ };
}
- /**
- * API Info as it appears on the swagger-ui page
- */
- private ApiInfo apiInfo() {
- return new ApiInfo(
- "Oppijan verkkopalvelukokonaisuus / ePerusteet-ylops rajapinta",
- "",
- "Spring MVC API based on the swagger 2.0 and 1.2 specification",
- null,
- null,
- "EUPL 1.1",
- "http://ec.europa.eu/idabc/eupl",
- new ArrayList<>());
+ @Bean
+ public ParameterCustomizer enumParameterCustomizer() {
+ return new ParameterCustomizer() {
+
+ @Override
+ public Parameter customize(Parameter parameter, MethodParameter methodParameter) {
+ Class> paramType = methodParameter.getParameterType();
+ if (paramType.isEnum()) {
+ parameter.getSchema().setEnum(Arrays.stream(paramType.getEnumConstants())
+ .map(enumConstant -> ((Enum>) enumConstant).name()) // Ensures uppercase
+ .collect(Collectors.toList()));
+ }
+ return parameter;
+ }
+ };
}
+ @Bean
+ public GroupedOpenApi externalOpenApi() {
+ return GroupedOpenApi.builder()
+ .group("external")
+ .packagesToScan("fi.vm.sade.eperusteet.ylops.resource.julkinen")
+ .pathsToMatch("/api/external/**")
+ .build();
+ }
}
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/WebSecurityConfiguration.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/WebSecurityConfiguration.java
index 3a7c110f8..480629340 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/WebSecurityConfiguration.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/WebSecurityConfiguration.java
@@ -1,14 +1,13 @@
package fi.vm.sade.eperusteet.ylops.config;
import fi.vm.sade.eperusteet.ylops.repository.OphSessionMappingStorage;
-import fi.vm.sade.eperusteet.ylops.service.util.RestClientFactoryImpl;
import fi.vm.sade.java_utils.security.OpintopolkuCasAuthenticationFilter;
import fi.vm.sade.javautils.http.auth.CasAuthenticator;
import fi.vm.sade.javautils.kayttooikeusclient.OphUserDetailsServiceImpl;
import lombok.extern.slf4j.Slf4j;
-import org.jasig.cas.client.session.SingleSignOutFilter;
-import org.jasig.cas.client.validation.Cas20ProxyTicketValidator;
-import org.jasig.cas.client.validation.TicketValidator;
+import org.apereo.cas.client.session.SingleSignOutFilter;
+import org.apereo.cas.client.validation.Cas20ProxyTicketValidator;
+import org.apereo.cas.client.validation.TicketValidator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
@@ -21,21 +20,20 @@
import org.springframework.security.cas.web.CasAuthenticationEntryPoint;
import org.springframework.security.cas.web.CasAuthenticationFilter;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
-import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
import org.springframework.security.web.authentication.logout.HeaderWriterLogoutHandler;
import org.springframework.security.web.header.writers.ClearSiteDataHeaderWriter;
-
-import javax.annotation.PostConstruct;
+import org.springframework.security.web.savedrequest.HttpSessionRequestCache;
@Slf4j
@Profile({"!dev & !test"})
@Configuration
-@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
+@EnableMethodSecurity(securedEnabled = true)
@EnableWebSecurity
public class WebSecurityConfiguration {
@@ -69,26 +67,11 @@ public class WebSecurityConfiguration {
@Autowired
private OphSessionMappingStorage ophSessionMappingStorage;
- @PostConstruct
- public void post() {
- log.info("caskey " + casKey);
- log.info("casService " + casService);
- log.info("casSendRenew " + casSendRenew);
- log.info("casLogin " + casLogin);
- log.info("hostAlb " + hostAlb);
- log.info("webUrlCas " + webUrlCas);
- }
-
@Bean
public CasAuthenticator casAuthenticator() {
return new CasAuthenticator(this.webUrlCas, eperusteet_username, eperusteet_password, hostAlb, null, false, null);
}
- @Bean
- public UserDetailsService userDetailsService() {
- return new OphUserDetailsServiceImpl(this.hostAlb, RestClientFactoryImpl.CALLER_ID, casAuthenticator());
- }
-
@Bean
public ServiceProperties serviceProperties() {
ServiceProperties serviceProperties = new ServiceProperties();
@@ -101,7 +84,7 @@ public ServiceProperties serviceProperties() {
@Bean
public CasAuthenticationProvider casAuthenticationProvider() {
CasAuthenticationProvider casAuthenticationProvider = new CasAuthenticationProvider();
- casAuthenticationProvider.setUserDetailsService(userDetailsService());
+ casAuthenticationProvider.setAuthenticationUserDetailsService(new OphUserDetailsServiceImpl());
casAuthenticationProvider.setServiceProperties(serviceProperties());
casAuthenticationProvider.setTicketValidator(ticketValidator());
casAuthenticationProvider.setKey(this.casKey);
@@ -147,18 +130,20 @@ public CasAuthenticationEntryPoint casAuthenticationEntryPoint() {
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
+
+ HttpSessionRequestCache requestCache = new HttpSessionRequestCache();
+ requestCache.setMatchingRequestParameterName(null);
+
http
- .csrf().disable()
- .authorizeRequests()
- .antMatchers("/buildversion.txt").permitAll()
- .antMatchers(HttpMethod.GET, "/api/**").permitAll()
- .antMatchers(HttpMethod.GET, "/").permitAll()
- .anyRequest().authenticated()
- .and()
+ .headers(AbstractHttpConfigurer::disable)
+ .csrf(AbstractHttpConfigurer::disable)
+ .authorizeHttpRequests((authorize) -> authorize
+ .requestMatchers("/actuator/health").permitAll()
+ .requestMatchers(HttpMethod.GET, "/api/**").permitAll()
+ .requestMatchers(HttpMethod.GET, "/").permitAll()
+ .anyRequest().authenticated())
.addFilter(casAuthenticationFilter(http))
- .exceptionHandling()
- .authenticationEntryPoint(casAuthenticationEntryPoint())
- .and()
+ .exceptionHandling(handling -> handling.authenticationEntryPoint(casAuthenticationEntryPoint()))
.addFilterBefore(singleSignOutFilter(), CasAuthenticationFilter.class)
.logout((logout) -> {
logout.logoutUrl("/api/logout");
@@ -166,7 +151,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
logout.addLogoutHandler(new HeaderWriterLogoutHandler(new ClearSiteDataHeaderWriter(ClearSiteDataHeaderWriter.Directive.ALL)));
logout.invalidateHttpSession(true);
})
- .headers().defaultsDisabled().cacheControl();
+ .requestCache(cache -> cache.requestCache(requestCache));
return http.build();
}
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/WebSecurityConfigurationDev.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/WebSecurityConfigurationDev.java
index 77c467e82..d6fa78327 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/WebSecurityConfigurationDev.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/config/WebSecurityConfigurationDev.java
@@ -7,9 +7,11 @@
import org.springframework.http.HttpMethod;
import org.springframework.security.access.vote.AffirmativeBased;
import org.springframework.security.access.vote.RoleVoter;
-import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+import org.springframework.security.config.Customizer;
+import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
@@ -18,34 +20,39 @@
import org.springframework.security.web.authentication.logout.HeaderWriterLogoutHandler;
import org.springframework.security.web.csrf.CookieCsrfTokenRepository;
import org.springframework.security.web.header.writers.ClearSiteDataHeaderWriter;
+import org.springframework.security.web.savedrequest.HttpSessionRequestCache;
import java.util.List;
@Profile({"dev"})
@Configuration
-@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
+@EnableMethodSecurity(securedEnabled = true)
@EnableWebSecurity
public class WebSecurityConfigurationDev {
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
+ HttpSessionRequestCache requestCache = new HttpSessionRequestCache();
+ requestCache.setMatchingRequestParameterName(null);
+
http
- .httpBasic()
- .and()
- .csrf().disable()
- .authorizeRequests()
- .antMatchers("/buildversion.txt").permitAll()
- .antMatchers(HttpMethod.GET, "/api/**").permitAll()
- .antMatchers(HttpMethod.POST, "/api/**").permitAll()
- .antMatchers(HttpMethod.GET, "/").permitAll()
- .anyRequest().authenticated()
- .and().logout(logout -> {
+ .csrf(AbstractHttpConfigurer::disable)
+ .authorizeHttpRequests((authorize) -> authorize
+ .requestMatchers("/actuator/health").permitAll()
+ .requestMatchers(HttpMethod.GET, "/api/**").permitAll()
+ .requestMatchers(HttpMethod.GET, "/api-docs/**").permitAll()
+ .requestMatchers(HttpMethod.GET, "/").permitAll()
+ .requestMatchers(HttpMethod.POST, "/api/dokumentit/pdf/**").permitAll()
+ .anyRequest().authenticated())
+ .httpBasic(Customizer.withDefaults())
+ .logout(logout -> {
logout.logoutUrl("/api/logout");
logout.logoutSuccessUrl("http://localhost:9040");
logout.addLogoutHandler(new HeaderWriterLogoutHandler(new ClearSiteDataHeaderWriter(ClearSiteDataHeaderWriter.Directive.ALL)));
logout.invalidateHttpSession(true);
})
- .headers().defaultsDisabled().cacheControl();
+ .requestCache(cache -> cache.requestCache(requestCache));
+
return http.build();
}
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/AbstractAuditedEntity.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/AbstractAuditedEntity.java
index ca1deb0b3..0c01fb7bf 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/AbstractAuditedEntity.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/AbstractAuditedEntity.java
@@ -4,12 +4,12 @@
import java.io.Serializable;
import java.util.Date;
-import javax.persistence.Column;
-import javax.persistence.MappedSuperclass;
-import javax.persistence.PrePersist;
-import javax.persistence.PreUpdate;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
+import jakarta.persistence.Column;
+import jakarta.persistence.MappedSuperclass;
+import jakarta.persistence.PrePersist;
+import jakarta.persistence.PreUpdate;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
import lombok.Getter;
import org.hibernate.envers.Audited;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/AbstractAuditedReferenceableEntity.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/AbstractAuditedReferenceableEntity.java
index e909deea8..71fcf3e17 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/AbstractAuditedReferenceableEntity.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/AbstractAuditedReferenceableEntity.java
@@ -1,9 +1,9 @@
package fi.vm.sade.eperusteet.ylops.domain;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.MappedSuperclass;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.MappedSuperclass;
import lombok.Getter;
import lombok.Setter;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/AbstractReferenceableEntity.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/AbstractReferenceableEntity.java
index a3cccb2ed..8aa7bb72f 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/AbstractReferenceableEntity.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/AbstractReferenceableEntity.java
@@ -1,10 +1,10 @@
package fi.vm.sade.eperusteet.ylops.domain;
import java.io.Serializable;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.MappedSuperclass;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.MappedSuperclass;
@MappedSuperclass
public abstract class AbstractReferenceableEntity implements ReferenceableEntity, Serializable {
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/LaajaalainenosaaminenViite.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/LaajaalainenosaaminenViite.java
index f172d116b..446ec0e0f 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/LaajaalainenosaaminenViite.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/LaajaalainenosaaminenViite.java
@@ -1,7 +1,7 @@
package fi.vm.sade.eperusteet.ylops.domain;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
import lombok.EqualsAndHashCode;
import lombok.Getter;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/Lukko.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/Lukko.java
index f56122325..932e6cf49 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/Lukko.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/Lukko.java
@@ -4,12 +4,12 @@
import java.time.Instant;
import java.util.Date;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import jakarta.persistence.Table;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
import lombok.Getter;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/Termi.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/Termi.java
index f13e58dbd..ca7f03d43 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/Termi.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/Termi.java
@@ -6,7 +6,7 @@
import java.io.Serializable;
import java.util.UUID;
-import javax.persistence.*;
+import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/Vuosiluokkakokonaisuusviite.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/Vuosiluokkakokonaisuusviite.java
index e8f5f1126..49278ec68 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/Vuosiluokkakokonaisuusviite.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/Vuosiluokkakokonaisuusviite.java
@@ -5,16 +5,16 @@
import java.util.EnumSet;
import java.util.Set;
import java.util.UUID;
-import javax.persistence.Cacheable;
-import javax.persistence.CollectionTable;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.Table;
+import jakarta.persistence.Cacheable;
+import jakarta.persistence.CollectionTable;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.Id;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.Table;
import lombok.Getter;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/cache/PerusteCache.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/cache/PerusteCache.java
index 254a4ee64..72c5f2887 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/cache/PerusteCache.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/cache/PerusteCache.java
@@ -12,21 +12,21 @@
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Immutable;
-import javax.persistence.Cacheable;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.SequenceGenerator;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.UniqueConstraint;
+import jakarta.persistence.Cacheable;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.Id;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.SequenceGenerator;
+import jakarta.persistence.Table;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import jakarta.persistence.UniqueConstraint;
import java.io.IOException;
import java.util.Date;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/dokumentti/Dokumentti.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/dokumentti/Dokumentti.java
index d47e0f2d2..e50214952 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/dokumentti/Dokumentti.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/dokumentti/Dokumentti.java
@@ -1,11 +1,23 @@
package fi.vm.sade.eperusteet.ylops.domain.dokumentti;
import fi.vm.sade.eperusteet.ylops.domain.teksti.Kieli;
+import jakarta.persistence.Basic;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.Lob;
+import jakarta.persistence.Table;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
-import javax.persistence.*;
-import javax.validation.constraints.NotNull;
import java.util.Date;
@Entity
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/dokumentti/DokumenttiKuva.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/dokumentti/DokumenttiKuva.java
index 7b5c54d82..a2f0cf832 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/dokumentti/DokumenttiKuva.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/dokumentti/DokumenttiKuva.java
@@ -1,22 +1,21 @@
package fi.vm.sade.eperusteet.ylops.domain.dokumentti;
import fi.vm.sade.eperusteet.ylops.domain.teksti.Kieli;
+import jakarta.persistence.Basic;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.Lob;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
-import javax.persistence.Basic;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Lob;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
-
@Entity
@Table(name = "dokumentti_kuva")
@Getter
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/koodisto/KoodistoKoodi.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/koodisto/KoodistoKoodi.java
index 1377fbcb4..d39da6433 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/koodisto/KoodistoKoodi.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/koodisto/KoodistoKoodi.java
@@ -1,13 +1,13 @@
package fi.vm.sade.eperusteet.ylops.domain.koodisto;
import java.io.Serializable;
-import javax.persistence.Cacheable;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.UniqueConstraint;
+import jakarta.persistence.Cacheable;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
import lombok.EqualsAndHashCode;
import lombok.Getter;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/liite/Liite.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/liite/Liite.java
index 8804df6a6..fd8207967 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/liite/Liite.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/liite/Liite.java
@@ -1,22 +1,22 @@
package fi.vm.sade.eperusteet.ylops.domain.liite;
+import jakarta.persistence.Basic;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Id;
+import jakarta.persistence.Lob;
+import jakarta.persistence.Table;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
+import lombok.Getter;
+
import java.io.Serializable;
import java.sql.Blob;
import java.util.Date;
import java.util.UUID;
-import javax.persistence.Basic;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.Id;
-import javax.persistence.Lob;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-
-import lombok.Getter;
@Entity
@Table(name = "liite")
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019LaajaAlainenOsaaminen.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019LaajaAlainenOsaaminen.java
index 4282df8bf..69c6cce1d 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019LaajaAlainenOsaaminen.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019LaajaAlainenOsaaminen.java
@@ -3,17 +3,16 @@
import fi.vm.sade.eperusteet.ylops.domain.AbstractAuditedReferenceableEntity;
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
-
@Entity
@Audited
@Table(name = "lops2019_oppiaine_laajaalainenosaaminen")
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Opintojakso.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Opintojakso.java
index 2535d580e..5090cc2ff 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Opintojakso.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Opintojakso.java
@@ -14,16 +14,16 @@
import org.hibernate.envers.RelationTargetAuditMode;
import org.hibernate.validator.constraints.NotEmpty;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.OrderColumn;
-import javax.persistence.Table;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.ManyToMany;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.OrderColumn;
+import jakarta.persistence.Table;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksoPoistettu.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksoPoistettu.java
index 4ba39dc72..275c4adac 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksoPoistettu.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksoPoistettu.java
@@ -9,7 +9,7 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.io.Serializable;
@Entity
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonKeskeinenSisalto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonKeskeinenSisalto.java
index 01d2d0ce0..6df6fd15e 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonKeskeinenSisalto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonKeskeinenSisalto.java
@@ -8,10 +8,10 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
@Entity
@Audited
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonModuuli.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonModuuli.java
index 59b1c3fd2..9ac1baacd 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonModuuli.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonModuuli.java
@@ -3,14 +3,16 @@
import fi.vm.sade.eperusteet.ylops.domain.AbstractAuditedReferenceableEntity;
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.*;
-import javax.validation.constraints.NotNull;
-
@Entity
@Audited
@Table(name = "lops2019_opintojakson_moduuli")
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonOppiaine.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonOppiaine.java
index 66f19a3e9..4aeeeb10f 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonOppiaine.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonOppiaine.java
@@ -5,9 +5,9 @@
import lombok.Setter;
import org.hibernate.envers.Audited;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
@Entity
@Audited
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonTavoite.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonTavoite.java
index c906f7543..6873dca67 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonTavoite.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpintojaksonTavoite.java
@@ -8,10 +8,10 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
@Entity
@Audited
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpiskeluymparistoTyotavat.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpiskeluymparistoTyotavat.java
index 03f077080..a205cc5cc 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpiskeluymparistoTyotavat.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OpiskeluymparistoTyotavat.java
@@ -3,10 +3,10 @@
import fi.vm.sade.eperusteet.ylops.domain.AbstractAuditedReferenceableEntity;
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Oppiaine.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Oppiaine.java
index 1f2c856aa..79d5c259e 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Oppiaine.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Oppiaine.java
@@ -6,25 +6,25 @@
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
import fi.vm.sade.eperusteet.ylops.dto.navigation.NavigationType;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.OrderColumn;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
import org.hibernate.validator.constraints.NotEmpty;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.OrderColumn;
-import javax.persistence.Table;
-import javax.persistence.UniqueConstraint;
-import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OppiaineJarjestys.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OppiaineJarjestys.java
index ae6209b0f..9f611dc8b 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OppiaineJarjestys.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OppiaineJarjestys.java
@@ -1,15 +1,14 @@
package fi.vm.sade.eperusteet.ylops.domain.lops2019;
import fi.vm.sade.eperusteet.ylops.domain.AbstractAuditedReferenceableEntity;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
-
@Entity
@Audited
@Table(name = "lops2019_oppiaine_jarjestys")
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OppiaineenTavoitealue.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OppiaineenTavoitealue.java
index e37e4efc1..6772794f3 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OppiaineenTavoitealue.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019OppiaineenTavoitealue.java
@@ -9,13 +9,13 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.Table;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.Table;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019PaikallinenArviointi.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019PaikallinenArviointi.java
index 578e446ba..c93106ac1 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019PaikallinenArviointi.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019PaikallinenArviointi.java
@@ -8,10 +8,10 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
@Entity
@Audited
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Sisalto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Sisalto.java
index c7f7461d4..f92e730c1 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Sisalto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Sisalto.java
@@ -7,7 +7,7 @@
import lombok.Setter;
import org.hibernate.envers.Audited;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Tavoite.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Tavoite.java
index 1ab9fd3a5..cd0f79394 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Tavoite.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Tavoite.java
@@ -8,7 +8,7 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.*;
+import jakarta.persistence.*;
@Entity
@Audited
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Tavoitteet.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Tavoitteet.java
index bbdb7529a..1528cf12d 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Tavoitteet.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Tavoitteet.java
@@ -8,13 +8,13 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.Table;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.Table;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Tehtava.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Tehtava.java
index e8f5384fa..7601c8412 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Tehtava.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Lops2019Tehtava.java
@@ -8,10 +8,10 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
@Entity
@Audited
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/PaikallinenLaajaAlainenOsaaminen.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/PaikallinenLaajaAlainenOsaaminen.java
index 2051c0597..e82c980c0 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/PaikallinenLaajaAlainenOsaaminen.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/PaikallinenLaajaAlainenOsaaminen.java
@@ -9,7 +9,7 @@
import org.hibernate.envers.RelationTargetAuditMode;
import org.hibernate.validator.constraints.NotEmpty;
-import javax.persistence.*;
+import jakarta.persistence.*;
@Entity
@Audited
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Poistettu.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Poistettu.java
index 413149caa..3279d7c2d 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Poistettu.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lops2019/Poistettu.java
@@ -4,13 +4,24 @@
import fi.vm.sade.eperusteet.ylops.domain.ops.Opetussuunnitelma;
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.*;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Entity
@@ -24,7 +35,8 @@ public class Poistettu extends AbstractAuditedEntity implements Serializable {
@GeneratedValue(strategy = GenerationType.SEQUENCE)
private Long id;
- @OneToOne(fetch = FetchType.LAZY)
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "opetussuunnitelma_id")
@NotNull
private Opetussuunnitelma opetussuunnitelma;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Aihekokonaisuudet.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Aihekokonaisuudet.java
index 1691e6eee..a51dd2312 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Aihekokonaisuudet.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Aihekokonaisuudet.java
@@ -12,7 +12,7 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Aihekokonaisuus.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Aihekokonaisuus.java
index ceb5dbc6b..ea43326fa 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Aihekokonaisuus.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Aihekokonaisuus.java
@@ -10,7 +10,7 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.util.UUID;
@Entity
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Kurssi.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Kurssi.java
index 401b52179..2545a4d7d 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Kurssi.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Kurssi.java
@@ -4,13 +4,21 @@
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml.WhitelistType;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.*;
-import javax.validation.constraints.NotNull;
import java.util.UUID;
@Entity
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/LukioOppiaineId.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/LukioOppiaineId.java
index 221ea19f2..7a7ea2caa 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/LukioOppiaineId.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/LukioOppiaineId.java
@@ -3,8 +3,8 @@
import lombok.Getter;
import lombok.Setter;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
import java.io.Serializable;
@Getter
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/LukioOppiaineJarjestys.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/LukioOppiaineJarjestys.java
index 79cd662d3..860a97b4f 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/LukioOppiaineJarjestys.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/LukioOppiaineJarjestys.java
@@ -7,7 +7,7 @@
import lombok.Setter;
import org.hibernate.envers.Audited;
-import javax.persistence.*;
+import jakarta.persistence.*;
@Getter
@Entity
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Lukiokurssi.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Lukiokurssi.java
index 757a592b2..680f036be 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Lukiokurssi.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/Lukiokurssi.java
@@ -8,28 +8,28 @@
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml.WhitelistType;
import fi.vm.sade.eperusteet.ylops.dto.lukio.LukioKurssiParentDto;
import fi.vm.sade.eperusteet.ylops.service.util.LambdaUtil.Copyable;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.ColumnResult;
+import jakarta.persistence.ConstructorResult;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.NamedNativeQueries;
+import jakarta.persistence.NamedNativeQuery;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.SqlResultSetMapping;
+import jakarta.persistence.SqlResultSetMappings;
+import jakarta.persistence.Table;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.ColumnResult;
-import javax.persistence.ConstructorResult;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.JoinColumn;
-import javax.persistence.NamedNativeQueries;
-import javax.persistence.NamedNativeQuery;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.SqlResultSetMapping;
-import javax.persistence.SqlResultSetMappings;
-import javax.persistence.Table;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.HashSet;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OpetuksenYleisetTavoitteet.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OpetuksenYleisetTavoitteet.java
index a143590f8..dcf854249 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OpetuksenYleisetTavoitteet.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OpetuksenYleisetTavoitteet.java
@@ -10,7 +10,7 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.util.UUID;
@Entity
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OppiaineLukiokurssi.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OppiaineLukiokurssi.java
index 9f52c681f..903d99843 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OppiaineLukiokurssi.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OppiaineLukiokurssi.java
@@ -7,7 +7,7 @@
import lombok.Setter;
import org.hibernate.envers.Audited;
-import javax.persistence.*;
+import jakarta.persistence.*;
@Entity
@Audited
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OpsOppiaineId.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OpsOppiaineId.java
index 9448fd71b..49532f443 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OpsOppiaineId.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OpsOppiaineId.java
@@ -1,8 +1,8 @@
package fi.vm.sade.eperusteet.ylops.domain.lukio;
import java.io.Serializable;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
import lombok.Getter;
import lombok.Setter;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OpsOppiaineParentView.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OpsOppiaineParentView.java
index 5914b250a..122e54244 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OpsOppiaineParentView.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/lukio/OpsOppiaineParentView.java
@@ -5,7 +5,7 @@
import java.io.Serializable;
import java.util.UUID;
-import javax.persistence.*;
+import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Keskeinensisaltoalue.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Keskeinensisaltoalue.java
index 72fbb54f6..4d2b3abac 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Keskeinensisaltoalue.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Keskeinensisaltoalue.java
@@ -5,10 +5,10 @@
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
import java.util.UUID;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/OpetuksenKeskeinensisaltoalue.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/OpetuksenKeskeinensisaltoalue.java
index 9977a7a0f..966805dcb 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/OpetuksenKeskeinensisaltoalue.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/OpetuksenKeskeinensisaltoalue.java
@@ -2,14 +2,22 @@
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.*;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Opetuksenkohdealue.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Opetuksenkohdealue.java
index 866bc567d..2e5f00d54 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Opetuksenkohdealue.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Opetuksenkohdealue.java
@@ -4,10 +4,10 @@
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Opetuksentavoite.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Opetuksentavoite.java
index 3acdac809..b78523625 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Opetuksentavoite.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Opetuksentavoite.java
@@ -10,16 +10,16 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.Table;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.ManyToMany;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.Table;
import java.util.HashSet;
import java.util.Map;
import java.util.Optional;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Oppiaine.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Oppiaine.java
index d3a949f37..b2fb257b9 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Oppiaine.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Oppiaine.java
@@ -14,28 +14,28 @@
import fi.vm.sade.eperusteet.ylops.service.util.LambdaUtil.ConstructedCopier;
import fi.vm.sade.eperusteet.ylops.service.util.LambdaUtil.Copier;
import fi.vm.sade.eperusteet.ylops.service.util.LambdaUtil.Copyable;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Transient;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.BatchSize;
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Oppiaineenvuosiluokka.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Oppiaineenvuosiluokka.java
index 487cf0895..ed3341563 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Oppiaineenvuosiluokka.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Oppiaineenvuosiluokka.java
@@ -7,6 +7,18 @@
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
import fi.vm.sade.eperusteet.ylops.dto.navigation.NavigationType;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.OrderColumn;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import jakarta.validation.constraints.NotNull;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
@@ -14,18 +26,6 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.OrderColumn;
-import javax.persistence.Table;
-import javax.persistence.UniqueConstraint;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Oppiaineenvuosiluokkakokonaisuus.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Oppiaineenvuosiluokkakokonaisuus.java
index 217595651..b264ea4ee 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Oppiaineenvuosiluokkakokonaisuus.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Oppiaineenvuosiluokkakokonaisuus.java
@@ -4,6 +4,18 @@
import fi.vm.sade.eperusteet.ylops.domain.Vuosiluokka;
import fi.vm.sade.eperusteet.ylops.domain.Vuosiluokkakokonaisuusviite;
import fi.vm.sade.eperusteet.ylops.domain.teksti.Tekstiosa;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.OrderColumn;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import jakarta.validation.constraints.NotNull;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
@@ -11,18 +23,6 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.OrderColumn;
-import javax.persistence.Table;
-import javax.persistence.UniqueConstraint;
-import javax.validation.constraints.NotNull;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/PoistettuOppiaine.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/PoistettuOppiaine.java
index 4803e2cb0..5f86eec78 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/PoistettuOppiaine.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/PoistettuOppiaine.java
@@ -6,7 +6,7 @@
import lombok.Setter;
import org.hibernate.envers.Audited;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.io.Serializable;
@Entity
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Tavoitteenarviointi.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Tavoitteenarviointi.java
index f20df1873..c7c9e7cd0 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Tavoitteenarviointi.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/Tavoitteenarviointi.java
@@ -4,10 +4,10 @@
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/VapaatekstiPaikallinentarkennus.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/VapaatekstiPaikallinentarkennus.java
index 190d61997..d0922546f 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/VapaatekstiPaikallinentarkennus.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/oppiaine/VapaatekstiPaikallinentarkennus.java
@@ -2,19 +2,19 @@
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Entity
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/JulkaistuOpetussuunnitelmaData.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/JulkaistuOpetussuunnitelmaData.java
index 2c8f5eb5b..99f28563a 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/JulkaistuOpetussuunnitelmaData.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/JulkaistuOpetussuunnitelmaData.java
@@ -1,22 +1,25 @@
package fi.vm.sade.eperusteet.ylops.domain.ops;
import com.fasterxml.jackson.databind.node.ObjectNode;
-import fi.vm.sade.eperusteet.ylops.repository.dialect.JsonBType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.PrePersist;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
-import org.hibernate.annotations.*;
-
-import javax.persistence.*;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
+import org.hibernate.annotations.Immutable;
+import org.hibernate.annotations.JdbcTypeCode;
+import org.hibernate.type.SqlTypes;
import org.springframework.context.annotation.Profile;
@Profile("!test")
@Entity
@Immutable
@Table(name = "opetussuunnitelman_julkaisu_data")
-@TypeDef(name = "jsonb", defaultForType = JsonBType.class, typeClass = JsonBType.class)
public class JulkaistuOpetussuunnitelmaData {
@Id
@@ -32,7 +35,7 @@ public class JulkaistuOpetussuunnitelmaData {
@NotNull
@Getter
@Setter
- @Type(type = "jsonb")
+ @JdbcTypeCode(SqlTypes.JSON)
@Column(name = "opsdata")
private ObjectNode opsData;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/JulkaistuOpetussuunnitelmaTila.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/JulkaistuOpetussuunnitelmaTila.java
index 43e6b47f0..067b66a13 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/JulkaistuOpetussuunnitelmaTila.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/JulkaistuOpetussuunnitelmaTila.java
@@ -1,19 +1,19 @@
package fi.vm.sade.eperusteet.ylops.domain.ops;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.Id;
+import jakarta.persistence.PrePersist;
+import jakarta.persistence.PreUpdate;
+import jakarta.persistence.Table;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.Id;
-import javax.persistence.PrePersist;
-import javax.persistence.PreUpdate;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/Kommentti2019.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/Kommentti2019.java
index 0f33a399e..8c3684685 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/Kommentti2019.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/Kommentti2019.java
@@ -1,13 +1,15 @@
package fi.vm.sade.eperusteet.ylops.domain.ops;
import fi.vm.sade.eperusteet.ylops.domain.AbstractAuditedReferenceableEntity;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
-import javax.persistence.*;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
import java.util.UUID;
/**
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/KommenttiKahva.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/KommenttiKahva.java
index 295a6eb9c..a5c325dce 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/KommenttiKahva.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/KommenttiKahva.java
@@ -2,12 +2,20 @@
import fi.vm.sade.eperusteet.ylops.domain.teksti.Kieli;
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Immutable;
-import javax.persistence.*;
-import javax.validation.constraints.NotNull;
import java.util.UUID;
/**
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/Opetussuunnitelma.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/Opetussuunnitelma.java
index d42ea7647..25d1a7abc 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/Opetussuunnitelma.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/Opetussuunnitelma.java
@@ -25,6 +25,28 @@
import fi.vm.sade.eperusteet.ylops.dto.navigation.NavigationType;
import fi.vm.sade.eperusteet.ylops.service.ops.Identifiable;
import fi.vm.sade.eperusteet.ylops.service.ops.OpsIdentifiable;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.CollectionTable;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.ManyToMany;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import jakarta.persistence.Transient;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.collections.CollectionUtils;
@@ -32,28 +54,6 @@
import org.hibernate.envers.NotAudited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.CollectionTable;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Comparator;
import java.util.Date;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmaAikataulu.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmaAikataulu.java
index 8daa82065..c7bebd3c6 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmaAikataulu.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmaAikataulu.java
@@ -4,20 +4,19 @@
import fi.vm.sade.eperusteet.ylops.domain.AikatauluTapahtuma;
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
-import java.util.Date;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.validation.constraints.NotNull;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
@@ -25,6 +24,8 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
+import java.util.Date;
+
@Getter
@Setter
@Entity
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmanJulkaisu.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmanJulkaisu.java
index 87bcb1643..996729081 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmanJulkaisu.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmanJulkaisu.java
@@ -4,24 +4,24 @@
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
import fi.vm.sade.eperusteet.ylops.service.util.SecurityUtil;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.PrePersist;
+import jakarta.persistence.Table;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Immutable;
-import javax.persistence.CascadeType;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToOne;
-import javax.persistence.PrePersist;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmanMuokkaustieto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmanMuokkaustieto.java
index cba67e949..94c3652e5 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmanMuokkaustieto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmanMuokkaustieto.java
@@ -4,25 +4,22 @@
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
import fi.vm.sade.eperusteet.ylops.dto.navigation.NavigationType;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Set;
-import javax.persistence.CascadeType;
-import javax.persistence.CollectionTable;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.validation.constraints.NotNull;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.CollectionTable;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
@@ -30,6 +27,10 @@
import lombok.Setter;
import org.hibernate.annotations.Immutable;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
@Getter
@Setter
@Entity
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmanMuokkaustietoLisaparametrit.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmanMuokkaustietoLisaparametrit.java
index e38866728..e35d3f0ef 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmanMuokkaustietoLisaparametrit.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpetussuunnitelmanMuokkaustietoLisaparametrit.java
@@ -1,16 +1,17 @@
package fi.vm.sade.eperusteet.ylops.domain.ops;
import fi.vm.sade.eperusteet.ylops.dto.navigation.NavigationType;
-import java.io.Serializable;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.validation.constraints.NotNull;
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
+import java.io.Serializable;
+
@Getter
@Embeddable
@AllArgsConstructor
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpsOppiaine.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpsOppiaine.java
index 9e38823d7..8ef59a07c 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpsOppiaine.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpsOppiaine.java
@@ -2,15 +2,15 @@
import fi.vm.sade.eperusteet.ylops.domain.oppiaine.Oppiaine;
import fi.vm.sade.eperusteet.ylops.service.util.LambdaUtil.ConstructedCopier;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
+import jakarta.persistence.ManyToOne;
+import jakarta.validation.constraints.NotNull;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.ManyToOne;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Embeddable
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpsVuosiluokkakokonaisuus.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpsVuosiluokkakokonaisuus.java
index 7cbcd3d0a..835fe6266 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpsVuosiluokkakokonaisuus.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpsVuosiluokkakokonaisuus.java
@@ -1,18 +1,18 @@
package fi.vm.sade.eperusteet.ylops.domain.ops;
import fi.vm.sade.eperusteet.ylops.domain.vuosiluokkakokonaisuus.Vuosiluokkakokonaisuus;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.OneToOne;
+import jakarta.validation.constraints.NotNull;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToOne;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Embeddable
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpsVuosiluokkakokonaisuusLisatieto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpsVuosiluokkakokonaisuusLisatieto.java
index c82c4084c..5103c8014 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpsVuosiluokkakokonaisuusLisatieto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ops/OpsVuosiluokkakokonaisuusLisatieto.java
@@ -6,14 +6,14 @@
import lombok.NoArgsConstructor;
import lombok.Setter;
-import javax.persistence.CollectionTable;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
+import jakarta.persistence.CollectionTable;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.Table;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/revision/RevisionInfo.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/revision/RevisionInfo.java
index 204467f9f..56a4fcdc2 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/revision/RevisionInfo.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/revision/RevisionInfo.java
@@ -2,11 +2,11 @@
import fi.vm.sade.eperusteet.ylops.service.internal.AuditRevisionListener;
-import javax.persistence.AttributeOverride;
-import javax.persistence.AttributeOverrides;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
+import jakarta.persistence.AttributeOverride;
+import jakarta.persistence.AttributeOverrides;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/Kommentti.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/Kommentti.java
index 881b931af..2c0704a86 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/Kommentti.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/Kommentti.java
@@ -1,12 +1,10 @@
package fi.vm.sade.eperusteet.ylops.domain.teksti;
import fi.vm.sade.eperusteet.ylops.domain.AbstractAuditedReferenceableEntity;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-import javax.validation.constraints.Size;
-
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/LokalisoituTeksti.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/LokalisoituTeksti.java
index a0c26b32a..e4dbfa79e 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/LokalisoituTeksti.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/LokalisoituTeksti.java
@@ -6,18 +6,18 @@
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Immutable;
-import javax.persistence.Cacheable;
-import javax.persistence.CascadeType;
-import javax.persistence.CollectionTable;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.OneToMany;
-import javax.persistence.Table;
+import jakarta.persistence.Cacheable;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.CollectionTable;
+import jakarta.persistence.Column;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.Table;
import java.io.Serializable;
import java.text.Normalizer;
import java.util.Collections;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/PoistettuTekstiKappale.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/PoistettuTekstiKappale.java
index 09d5456b4..34672bd95 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/PoistettuTekstiKappale.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/PoistettuTekstiKappale.java
@@ -6,15 +6,15 @@
import lombok.Setter;
import org.hibernate.envers.Audited;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
import java.io.Serializable;
@Entity
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/Teksti.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/Teksti.java
index 21b08d817..48171b45e 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/Teksti.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/Teksti.java
@@ -1,12 +1,13 @@
package fi.vm.sade.eperusteet.ylops.domain.teksti;
+import jakarta.persistence.Column;
+import jakarta.persistence.Embeddable;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.validation.constraints.NotNull;
+
import java.io.Serializable;
import java.util.Objects;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.validation.constraints.NotNull;
@Embeddable
class Teksti implements Serializable {
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/TekstiKappale.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/TekstiKappale.java
index 8a9a30c33..db8d1600d 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/TekstiKappale.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/TekstiKappale.java
@@ -6,23 +6,23 @@
import fi.vm.sade.eperusteet.ylops.domain.Tila;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
import fi.vm.sade.eperusteet.ylops.dto.navigation.NavigationType;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.UUID;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/TekstiKappaleViite.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/TekstiKappaleViite.java
index 1c23418d3..8dacd2187 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/TekstiKappaleViite.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/TekstiKappaleViite.java
@@ -3,26 +3,26 @@
import fi.vm.sade.eperusteet.ylops.domain.HistoriaTapahtuma;
import fi.vm.sade.eperusteet.ylops.domain.ReferenceableEntity;
import fi.vm.sade.eperusteet.ylops.dto.navigation.NavigationType;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.NamedNativeQuery;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.OrderColumn;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.BatchSize;
import org.hibernate.envers.Audited;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.NamedNativeQuery;
-import javax.persistence.OneToMany;
-import javax.persistence.OrderColumn;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/Tekstiosa.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/Tekstiosa.java
index a7d238385..fd570323f 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/Tekstiosa.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/teksti/Tekstiosa.java
@@ -6,14 +6,14 @@
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
import java.io.Serializable;
@Audited
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ukk/Kysymys.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ukk/Kysymys.java
index c6db060e0..b2be4c509 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ukk/Kysymys.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/ukk/Kysymys.java
@@ -3,13 +3,19 @@
import fi.vm.sade.eperusteet.ylops.domain.AbstractAuditedEntity;
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.ElementCollection;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.ManyToOne;
+import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.*;
-import javax.validation.constraints.Size;
import java.util.HashSet;
import java.util.Set;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/validation/ValidHtml.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/validation/ValidHtml.java
index e157230d8..2734f0ee3 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/validation/ValidHtml.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/validation/ValidHtml.java
@@ -1,9 +1,9 @@
package fi.vm.sade.eperusteet.ylops.domain.validation;
+import jakarta.validation.Constraint;
+import jakarta.validation.Payload;
import org.jsoup.safety.Safelist;
-import javax.validation.Constraint;
-import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/validation/ValidHtmlCollectionValidator.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/validation/ValidHtmlCollectionValidator.java
index a8473e0f0..c99a454b8 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/validation/ValidHtmlCollectionValidator.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/validation/ValidHtmlCollectionValidator.java
@@ -1,9 +1,9 @@
package fi.vm.sade.eperusteet.ylops.domain.validation;
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
+import jakarta.validation.ConstraintValidator;
+import jakarta.validation.ConstraintValidatorContext;
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
import java.util.Collection;
public class ValidHtmlCollectionValidator extends ValidHtmlValidatorBase implements
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/validation/ValidHtmlValidator.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/validation/ValidHtmlValidator.java
index 082efb580..1941fe093 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/validation/ValidHtmlValidator.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/validation/ValidHtmlValidator.java
@@ -1,9 +1,8 @@
package fi.vm.sade.eperusteet.ylops.domain.validation;
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
+import jakarta.validation.ConstraintValidator;
+import jakarta.validation.ConstraintValidatorContext;
public class ValidHtmlValidator extends ValidHtmlValidatorBase implements
ConstraintValidator {
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/vuosiluokkakokonaisuus/Laajaalainenosaaminen.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/vuosiluokkakokonaisuus/Laajaalainenosaaminen.java
index 380fa3b0f..1b210e35d 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/vuosiluokkakokonaisuus/Laajaalainenosaaminen.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/vuosiluokkakokonaisuus/Laajaalainenosaaminen.java
@@ -4,20 +4,19 @@
import fi.vm.sade.eperusteet.ylops.domain.LaajaalainenosaaminenViite;
import fi.vm.sade.eperusteet.ylops.domain.teksti.LokalisoituTeksti;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Embedded;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Embedded;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
-
@Entity
@Audited
@Table(name = "vlkok_laaja_osaaminen")
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/vuosiluokkakokonaisuus/Vuosiluokkakokonaisuus.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/vuosiluokkakokonaisuus/Vuosiluokkakokonaisuus.java
index f286cf110..ad777118f 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/vuosiluokkakokonaisuus/Vuosiluokkakokonaisuus.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/domain/vuosiluokkakokonaisuus/Vuosiluokkakokonaisuus.java
@@ -9,23 +9,23 @@
import fi.vm.sade.eperusteet.ylops.domain.teksti.Tekstiosa;
import fi.vm.sade.eperusteet.ylops.domain.validation.ValidHtml;
import fi.vm.sade.eperusteet.ylops.dto.navigation.NavigationType;
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.OneToMany;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.envers.Audited;
import org.hibernate.envers.RelationTargetAuditMode;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lops2019/Lops2019OppiaineGenericDto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lops2019/Lops2019OppiaineGenericDto.java
index c27360e87..fcd613156 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lops2019/Lops2019OppiaineGenericDto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lops2019/Lops2019OppiaineGenericDto.java
@@ -3,6 +3,7 @@
import fi.vm.sade.eperusteet.ylops.dto.peruste.lops2019.oppiaineet.Lops2019OppiaineBaseDto;
import fi.vm.sade.eperusteet.ylops.dto.peruste.lops2019.oppiaineet.moduuli.Lops2019ModuuliBaseDto;
import fi.vm.sade.eperusteet.ylops.dto.teksti.LokalisoituTekstiDto;
+import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -20,6 +21,8 @@ public class Lops2019OppiaineGenericDto<
ModuuliTyyppi extends Lops2019ModuuliBaseDto> extends Lops2019OppiaineBaseDto {
private LokalisoituTekstiDto pakollisetModuulitKuvaus;
private LokalisoituTekstiDto valinnaisetModuulitKuvaus;
+ @Schema(name = "moduulit")
private List moduulit = new ArrayList<>();
+ @Schema(name = "oppimaarat")
private List oppimaarat = new ArrayList<>();
}
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/AihekokonaisuudetJarjestaDto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/AihekokonaisuudetJarjestaDto.java
index 345e4cb4a..6bae9cd00 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/AihekokonaisuudetJarjestaDto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/AihekokonaisuudetJarjestaDto.java
@@ -1,11 +1,11 @@
package fi.vm.sade.eperusteet.ylops.dto.lukio;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/AihekokonaisuusJarjestysDto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/AihekokonaisuusJarjestysDto.java
index 6ae6b8888..34f35c01f 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/AihekokonaisuusJarjestysDto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/AihekokonaisuusJarjestysDto.java
@@ -1,11 +1,10 @@
package fi.vm.sade.eperusteet.ylops.dto.lukio;
+import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
-import javax.validation.constraints.NotNull;
-
@Data
@AllArgsConstructor
@NoArgsConstructor
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/AihekokonaisuusSaveDto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/AihekokonaisuusSaveDto.java
index 81fe622e7..f02c496ac 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/AihekokonaisuusSaveDto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/AihekokonaisuusSaveDto.java
@@ -1,11 +1,11 @@
package fi.vm.sade.eperusteet.ylops.dto.lukio;
import fi.vm.sade.eperusteet.ylops.dto.teksti.LokalisoituTekstiDto;
+import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Data
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukioAbstraktiOppiaineTuontiDto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukioAbstraktiOppiaineTuontiDto.java
index e1ac27ef8..db9d59319 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukioAbstraktiOppiaineTuontiDto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukioAbstraktiOppiaineTuontiDto.java
@@ -1,11 +1,11 @@
package fi.vm.sade.eperusteet.ylops.dto.lukio;
import fi.vm.sade.eperusteet.ylops.dto.teksti.LokalisoituTekstiDto;
+import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.UUID;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukioKopioiOppimaaraDto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukioKopioiOppimaaraDto.java
index da71073ca..04f0fe5c7 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukioKopioiOppimaaraDto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukioKopioiOppimaaraDto.java
@@ -1,11 +1,11 @@
package fi.vm.sade.eperusteet.ylops.dto.lukio;
import fi.vm.sade.eperusteet.ylops.dto.teksti.LokalisoituTekstiDto;
+import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
-import javax.validation.constraints.NotNull;
import java.util.UUID;
@Data
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukiokurssiOppaineMuokkausDto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukiokurssiOppaineMuokkausDto.java
index ec296ecad..8ac7cee24 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukiokurssiOppaineMuokkausDto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukiokurssiOppaineMuokkausDto.java
@@ -1,11 +1,11 @@
package fi.vm.sade.eperusteet.ylops.dto.lukio;
import fi.vm.sade.eperusteet.ylops.dto.IdHolder;
+import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukiokurssiSaveDto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukiokurssiSaveDto.java
index 0a8dd4eae..a1520a7c8 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukiokurssiSaveDto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukiokurssiSaveDto.java
@@ -3,11 +3,11 @@
import fi.vm.sade.eperusteet.ylops.domain.lukio.LukiokurssiTyyppi;
import fi.vm.sade.eperusteet.ylops.dto.teksti.LokalisoituTekstiDto;
import fi.vm.sade.eperusteet.ylops.service.external.impl.perustedto.TekstiOsaDto;
+import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukiokurssiUpdateDto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukiokurssiUpdateDto.java
index eed5a5e2a..b644d7a9e 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukiokurssiUpdateDto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/lukio/LukiokurssiUpdateDto.java
@@ -3,11 +3,11 @@
import fi.vm.sade.eperusteet.ylops.domain.lukio.LukiokurssiTyyppi;
import fi.vm.sade.eperusteet.ylops.dto.teksti.LokalisoituTekstiDto;
import fi.vm.sade.eperusteet.ylops.service.external.impl.perustedto.TekstiOsaDto;
+import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
-import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/ops/OppiaineSuppeaDto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/ops/OppiaineSuppeaDto.java
index ecdd83d6c..af021ce7f 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/ops/OppiaineSuppeaDto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/ops/OppiaineSuppeaDto.java
@@ -1,5 +1,6 @@
package fi.vm.sade.eperusteet.ylops.dto.ops;
+import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -12,6 +13,8 @@
@AllArgsConstructor
@NoArgsConstructor
public class OppiaineSuppeaDto extends OppiaineBaseDto {
+
+ @Schema(name = "oppimaarat")
private Set oppimaarat;
private Set vuosiluokkakokonaisuudet;
private String koodiUri;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/peruste/PerusteKeskeinensisaltoalueDto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/peruste/PerusteKeskeinensisaltoalueDto.java
index 62881eb5b..a64d4f245 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/peruste/PerusteKeskeinensisaltoalueDto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/peruste/PerusteKeskeinensisaltoalueDto.java
@@ -4,13 +4,12 @@
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import fi.vm.sade.eperusteet.ylops.dto.ReferenceableDto;
import fi.vm.sade.eperusteet.ylops.dto.teksti.LokalisoituTekstiDto;
-
-import java.util.UUID;
-
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
+import java.util.UUID;
+
@Data
@AllArgsConstructor
@NoArgsConstructor
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/peruste/PerusteOpetuksentavoiteDto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/peruste/PerusteOpetuksentavoiteDto.java
index 9497beb0c..23d6bd49c 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/peruste/PerusteOpetuksentavoiteDto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/peruste/PerusteOpetuksentavoiteDto.java
@@ -4,15 +4,14 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import fi.vm.sade.eperusteet.ylops.dto.ReferenceableDto;
import fi.vm.sade.eperusteet.ylops.dto.teksti.LokalisoituTekstiDto;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
import java.util.List;
import java.util.Set;
import java.util.UUID;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
@Data
@AllArgsConstructor
@NoArgsConstructor
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/peruste/PerusteOppiaineDto.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/peruste/PerusteOppiaineDto.java
index e6b1c2e90..ff8758038 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/peruste/PerusteOppiaineDto.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/dto/peruste/PerusteOppiaineDto.java
@@ -4,6 +4,7 @@
import fi.vm.sade.eperusteet.ylops.dto.ReferenceableDto;
import fi.vm.sade.eperusteet.ylops.dto.teksti.LokalisoituTekstiDto;
import fi.vm.sade.eperusteet.ylops.service.external.impl.perustedto.TekstiKappaleDto;
+import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -27,6 +28,7 @@ public class PerusteOppiaineDto implements ReferenceableDto {
private LokalisoituTekstiDto nimi;
private PerusteTekstiOsaDto tehtava;
private List vapaatTekstit;
+ @Schema(name = "oppimaarat")
private Set oppimaarat;
private Set kohdealueet;
private List vuosiluokkakokonaisuudet;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/OphSessionMappingStorage.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/OphSessionMappingStorage.java
index dd31b6cee..69f7e477b 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/OphSessionMappingStorage.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/OphSessionMappingStorage.java
@@ -1,6 +1,7 @@
package fi.vm.sade.eperusteet.ylops.repository;
-import org.jasig.cas.client.session.SessionMappingStorage;
+
+import org.apereo.cas.client.session.SessionMappingStorage;
public interface OphSessionMappingStorage extends SessionMappingStorage {
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/custom/OphSessionMappingStorageImpl.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/custom/OphSessionMappingStorageImpl.java
index 7100c0939..8f08762a5 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/custom/OphSessionMappingStorageImpl.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/custom/OphSessionMappingStorageImpl.java
@@ -1,21 +1,20 @@
package fi.vm.sade.eperusteet.ylops.repository.custom;
import fi.vm.sade.eperusteet.ylops.repository.OphSessionMappingStorage;
+import jakarta.servlet.ServletContext;
+import jakarta.servlet.http.HttpSession;
import org.springframework.dao.IncorrectResultSizeDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.SingleColumnRowMapper;
import org.springframework.session.Session;
import org.springframework.session.SessionRepository;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpSession;
import java.time.Duration;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
-import java.util.Set;
public class OphSessionMappingStorageImpl implements OphSessionMappingStorage {
@@ -112,52 +111,26 @@ public int getMaxInactiveInterval() {
return (int) session.getMaxInactiveInterval().getSeconds();
}
- @Override
- public javax.servlet.http.HttpSessionContext getSessionContext() {
- return new EmptyHttpSessionContext();
- }
-
@Override
public Object getAttribute(String name) {
return session.getAttribute(name);
}
- @Override
- public Object getValue(String name) {
- return getAttribute(name);
- }
-
@Override
public Enumeration getAttributeNames() {
return Collections.enumeration(session.getAttributeNames());
}
- @Override
- public String[] getValueNames() {
- Set attributeNames = session.getAttributeNames();
- return attributeNames.toArray(new String[attributeNames.size()]);
- }
-
@Override
public void setAttribute(String name, Object value) {
session.setAttribute(name, value);
}
- @Override
- public void putValue(String name, Object value) {
- setAttribute(name, value);
- }
-
@Override
public void removeAttribute(String name) {
session.removeAttribute(name);
}
- @Override
- public void removeValue(String name) {
- removeAttribute(name);
- }
-
@Override
public void invalidate() {
sessionRepository.deleteById(session.getId());
@@ -169,17 +142,4 @@ public boolean isNew() {
}
}
- @SuppressWarnings("deprecation")
- private static class EmptyHttpSessionContext implements javax.servlet.http.HttpSessionContext {
-
- @Override
- public HttpSession getSession(String sessionId) {
- return null;
- }
-
- @Override
- public Enumeration getIds() {
- return Collections.emptyEnumeration();
- }
- }
}
\ No newline at end of file
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/dialect/JsonBType.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/dialect/JsonBType.java
index a4edffc92..7bbdd8ff1 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/dialect/JsonBType.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/dialect/JsonBType.java
@@ -3,7 +3,6 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;
import fi.vm.sade.eperusteet.ylops.resource.config.InitJacksonConverter;
import fi.vm.sade.eperusteet.ylops.service.exception.BusinessRuleViolationException;
@@ -23,8 +22,8 @@ public class JsonBType implements UserType, Serializable {
private final ObjectMapper mapper = InitJacksonConverter.createMapper();
@Override
- public int[] sqlTypes() {
- return new int[]{Types.JAVA_OBJECT};
+ public int getSqlType() {
+ return Types.JAVA_OBJECT;
}
@Override
@@ -37,20 +36,6 @@ public boolean equals(Object x, Object y) throws HibernateException {
return Objects.equals(x, y);
}
- @Override
- public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException {
- String str = rs.getString(names[0]);
- if (str != null) {
- try {
- JsonNode node = mapper.readTree(str);
- return node;
- } catch (IOException e) {
- throw new BusinessRuleViolationException("datan-luku-epaonnistui");
- }
- }
- return JsonNodeFactory.instance.objectNode();
- }
-
@Override
public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException {
if (value != null) {
@@ -84,6 +69,11 @@ public int hashCode(Object x) throws HibernateException {
return 0;
}
+ @Override
+ public Object nullSafeGet(ResultSet rs, int position, SharedSessionContractImplementor session, Object owner) throws SQLException {
+ return null;
+ }
+
@Override
public boolean isMutable() {
return false;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/impl/JulkaisuRepositoryImpl.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/impl/JulkaisuRepositoryImpl.java
index 5811a4140..8a39ba4d3 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/impl/JulkaisuRepositoryImpl.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/impl/JulkaisuRepositoryImpl.java
@@ -7,9 +7,9 @@
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Repository;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceException;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.PersistenceContext;
+import jakarta.persistence.PersistenceException;
import java.io.IOException;
@Profile("!test")
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/liite/impl/LiiteRepositoryImpl.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/liite/impl/LiiteRepositoryImpl.java
index 0ef3f4772..ff105456d 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/liite/impl/LiiteRepositoryImpl.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/liite/impl/LiiteRepositoryImpl.java
@@ -2,14 +2,14 @@
import fi.vm.sade.eperusteet.ylops.domain.liite.Liite;
import fi.vm.sade.eperusteet.ylops.repository.liite.LiiteRepositoryCustom;
+import jakarta.persistence.EntityManager;
+import org.apache.commons.io.IOUtils;
+import org.hibernate.engine.jdbc.BlobProxy;
+import org.springframework.beans.factory.annotation.Autowired;
+import java.io.IOException;
import java.io.InputStream;
import java.sql.Blob;
-import javax.persistence.EntityManager;
-
-import org.hibernate.Hibernate;
-import org.hibernate.Session;
-import org.springframework.beans.factory.annotation.Autowired;
public class LiiteRepositoryImpl implements LiiteRepositoryCustom {
@@ -18,8 +18,12 @@ public class LiiteRepositoryImpl implements LiiteRepositoryCustom {
@Override
public Liite add(String tyyppi, String nimi, long length, InputStream is) {
- Session session = em.unwrap(Session.class);
- Blob blob = Hibernate.getLobCreator(session).createBlob(is, length);
+ Blob blob = null;
+ try {
+ blob = BlobProxy.generateProxy(IOUtils.toByteArray(is));
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
Liite liite = new Liite(tyyppi, nimi, blob);
em.persist(liite);
return liite;
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/lops2019/PoistetutRepository.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/lops2019/PoistetutRepository.java
index 2e52cf65d..239add30d 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/lops2019/PoistetutRepository.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/lops2019/PoistetutRepository.java
@@ -17,7 +17,7 @@ public interface PoistetutRepository extends JpaWithVersioningRepository>:kieli) LIKE LOWER(CONCAT('%',:nimi,'%')) OR EXISTS (SELECT 1 FROM jsonb_array_elements(organisaatiot) elem WHERE LOWER(elem->'nimi'->>:kieli) LIKE LOWER(CONCAT('%',:nimi,'%')))) " +
" AND (:perusteenDiaarinumero = '' OR peruste->>'diaarinumero' = :perusteenDiaarinumero) " +
- " AND (COALESCE(:koulutustyypit, NULL) = '' OR koulutustyyppi IN (:koulutustyypit)) " +
+ " AND (COALESCE(:koulutustyypit, NULL) IS NULL OR koulutustyyppi IN (:koulutustyypit)) " +
" order by nimi->>:kieli asc " +
") t";
diff --git a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/ops/OpetussuunnitelmaRepository.java b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/ops/OpetussuunnitelmaRepository.java
index 21aa96ab0..ea72d102d 100644
--- a/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/ops/OpetussuunnitelmaRepository.java
+++ b/eperusteet-ylops-service/src/main/java/fi/vm/sade/eperusteet/ylops/repository/ops/OpetussuunnitelmaRepository.java
@@ -64,43 +64,42 @@ List findAllByTyyppi(@Param("tyyppi") Tyyppi tyyppi,
@Param("organisaatiot") Collection organisaatiot);
String limitedPagedOpetussuunnitelmat =
- "FROM Opetussuunnitelma o " +
- "JOIN o.organisaatiot org " +
- "LEFT JOIN o.nimi nimi " +
+ "FROM Opetussuunnitelma ops " +
+ "JOIN ops.organisaatiot org " +
+ "LEFT JOIN ops.nimi nimi " +
"LEFT JOIN nimi.teksti teksti " +
- "WHERE o.tyyppi = :tyyppi " +
+ "WHERE ops.tyyppi = :tyyppi " +
"AND ( " +
- " (:tila = 'JULKAISTU' AND o.tila != 'POISTETTU' AND (o.julkaisut IS NOT EMPTY OR o.tila = 'JULKAISTU')) " +
- " OR (:tila = 'POISTETTU' AND o.tila = :tila)" +
- " OR (o.tila = :tila AND o.julkaisut IS EMPTY)" +
+ " (:tila = fi.vm.sade.eperusteet.ylops.domain.Tila.JULKAISTU AND ops.tila != fi.vm.sade.eperusteet.ylops.domain.Tila.POISTETTU AND (ops.julkaisut IS NOT EMPTY OR ops.tila = fi.vm.sade.eperusteet.ylops.domain.Tila.JULKAISTU)) " +
+ " OR (:tila = fi.vm.sade.eperusteet.ylops.domain.Tila.POISTETTU AND ops.tila = :tila)" +
+ " OR (ops.tila = :tila AND ops.julkaisut IS EMPTY)" +
" ) " +
- "AND (coalesce(:nimi, null) IS NULL or LOWER(teksti.teksti) LIKE LOWER(CONCAT('%',:nimi,'%'))) " +
+ "AND (:nimi IS NULL or LOWER(teksti.teksti) LIKE LOWER(CONCAT('%',:nimi,'%'))) " +
"AND teksti.kieli = :kieli " +
- "AND (:koulutustyyppi = '' or o.koulutustyyppi = :koulutustyyppi) ";
+ "AND (:koulutustyyppi IS NULL or ops.koulutustyyppi = :koulutustyyppi) ";
String limitedPagedOpetussuunnitelmatOrganisaatiot = "AND org IS NOT NULL AND org IN (:organisaatiot)";
@Query(
- value = "SELECT DISTINCT o, teksti.teksti " + limitedPagedOpetussuunnitelmat + limitedPagedOpetussuunnitelmatOrganisaatiot,
- countQuery = "SELECT COUNT(distinct o) " + limitedPagedOpetussuunnitelmat + limitedPagedOpetussuunnitelmatOrganisaatiot)
+ value = "SELECT DISTINCT ops, teksti.teksti " + limitedPagedOpetussuunnitelmat + limitedPagedOpetussuunnitelmatOrganisaatiot,
+ countQuery = "SELECT COUNT(distinct ops) " + limitedPagedOpetussuunnitelmat + limitedPagedOpetussuunnitelmatOrganisaatiot)
Page