From 4c8536f6f74a40ca9000fbf705bb8356bd647547 Mon Sep 17 00:00:00 2001 From: Josias Polchau Date: Sat, 11 Mar 2023 23:30:27 +0100 Subject: [PATCH] spring-boot-starter-parent from 2.7.4 to 3.0.4 #233 upgrade to javax to jakarta --- src/main/java/org/tb/auth/AfterLogin.java | 4 ++-- .../java/org/tb/chicoree/ChicoreeSessionStore.java | 2 +- .../configuration/BuildInformationProvider.java | 6 +++--- .../configuration/PerformanceLoggingFilter.java | 6 +++--- .../ResourceUrlProviderExposingFilter.java | 14 +++++++------- .../org/tb/common/jsptags/FormatDurationTag.java | 6 +++--- .../org/tb/common/jsptags/FormatLocalDateTag.java | 6 +++--- .../tb/common/jsptags/FormatLocalDateTimeTag.java | 6 +++--- .../org/tb/common/jsptags/FormatYearMonthTag.java | 6 +++--- src/main/java/org/tb/common/jsptags/TreeTag.java | 4 ++-- .../common/struts/DelegatingRequestProcessor.java | 2 +- .../java/org/tb/common/struts/TypedAction.java | 2 ++ src/main/java/org/tb/common/util/UrlUtils.java | 2 +- .../java/org/tb/customer/CustomerRepository.java | 5 ++++- .../dailyreport/action/ShowDailyReportAction.java | 2 +- .../tb/dailyreport/viewhelper/VacationViewer.java | 2 +- .../employee/persistence/EmployeeRepository.java | 5 ++++- .../persistence/EmployeecontractRepository.java | 2 ++ .../employee/persistence/OvertimeRepository.java | 5 ++++- src/main/java/org/tb/invoice/ExcelArchivierer.java | 2 +- .../order/persistence/CustomerorderRepository.java | 3 +++ .../org/tb/order/viewhelper/SuborderHelper.java | 2 +- .../persistence/ReportDefinitionRepository.java | 5 ++++- 23 files changed, 59 insertions(+), 40 deletions(-) diff --git a/src/main/java/org/tb/auth/AfterLogin.java b/src/main/java/org/tb/auth/AfterLogin.java index b5c927861..86bb93e05 100644 --- a/src/main/java/org/tb/auth/AfterLogin.java +++ b/src/main/java/org/tb/auth/AfterLogin.java @@ -5,8 +5,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -import jakarta.servlet.ServletContext; -import jakarta.servlet.http.HttpSession; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpSession; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.struts.util.MessageResources; diff --git a/src/main/java/org/tb/chicoree/ChicoreeSessionStore.java b/src/main/java/org/tb/chicoree/ChicoreeSessionStore.java index 14b99c27b..5a500ada4 100644 --- a/src/main/java/org/tb/chicoree/ChicoreeSessionStore.java +++ b/src/main/java/org/tb/chicoree/ChicoreeSessionStore.java @@ -12,7 +12,7 @@ import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import jakarta.servlet.http.HttpSession; +import javax.servlet.http.HttpSession; import lombok.Getter; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/tb/common/configuration/BuildInformationProvider.java b/src/main/java/org/tb/common/configuration/BuildInformationProvider.java index e08e405d7..14776ed70 100644 --- a/src/main/java/org/tb/common/configuration/BuildInformationProvider.java +++ b/src/main/java/org/tb/common/configuration/BuildInformationProvider.java @@ -1,9 +1,9 @@ package org.tb.common.configuration; import java.util.Properties; -import jakarta.servlet.ServletContext; -import jakarta.servlet.ServletContextEvent; -import jakarta.servlet.ServletContextListener; +import javax.servlet.ServletContext; +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/main/java/org/tb/common/configuration/PerformanceLoggingFilter.java b/src/main/java/org/tb/common/configuration/PerformanceLoggingFilter.java index df53871c9..d8b2e1d2d 100644 --- a/src/main/java/org/tb/common/configuration/PerformanceLoggingFilter.java +++ b/src/main/java/org/tb/common/configuration/PerformanceLoggingFilter.java @@ -1,9 +1,9 @@ package org.tb.common.configuration; import java.io.IOException; -import jakarta.servlet.FilterChain; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpFilter; +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpFilter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/org/tb/common/configuration/ResourceUrlProviderExposingFilter.java b/src/main/java/org/tb/common/configuration/ResourceUrlProviderExposingFilter.java index 88d5ef8a0..53aad0ed6 100644 --- a/src/main/java/org/tb/common/configuration/ResourceUrlProviderExposingFilter.java +++ b/src/main/java/org/tb/common/configuration/ResourceUrlProviderExposingFilter.java @@ -1,11 +1,11 @@ package org.tb.common.configuration; +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpFilter; import java.io.IOException; -import jakarta.servlet.FilterChain; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpFilter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.ServletRequestBindingException; @@ -19,8 +19,8 @@ public class ResourceUrlProviderExposingFilter extends HttpFilter { private final ResourceUrlProvider resourceUrlProvider; @Override - protected void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) - throws IOException, ServletException { + public void doFilter( + ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try { request.setAttribute(RESOURCE_URL_PROVIDER_ATTR, this.resourceUrlProvider); } diff --git a/src/main/java/org/tb/common/jsptags/FormatDurationTag.java b/src/main/java/org/tb/common/jsptags/FormatDurationTag.java index fa9cccc22..40ce09964 100644 --- a/src/main/java/org/tb/common/jsptags/FormatDurationTag.java +++ b/src/main/java/org/tb/common/jsptags/FormatDurationTag.java @@ -3,9 +3,9 @@ import java.io.IOException; import java.time.Duration; import java.time.LocalDate; -import jakarta.servlet.jsp.JspException; -import jakarta.servlet.jsp.JspWriter; -import jakarta.servlet.jsp.tagext.TagSupport; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import javax.servlet.jsp.tagext.TagSupport; import lombok.Setter; import org.tb.common.util.DurationUtils; diff --git a/src/main/java/org/tb/common/jsptags/FormatLocalDateTag.java b/src/main/java/org/tb/common/jsptags/FormatLocalDateTag.java index ae4dcca5b..7a2586ced 100644 --- a/src/main/java/org/tb/common/jsptags/FormatLocalDateTag.java +++ b/src/main/java/org/tb/common/jsptags/FormatLocalDateTag.java @@ -2,9 +2,9 @@ import java.io.IOException; import java.time.LocalDate; -import jakarta.servlet.jsp.JspException; -import jakarta.servlet.jsp.JspWriter; -import jakarta.servlet.jsp.tagext.TagSupport; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import javax.servlet.jsp.tagext.TagSupport; import lombok.Setter; import org.tb.common.util.DateUtils; diff --git a/src/main/java/org/tb/common/jsptags/FormatLocalDateTimeTag.java b/src/main/java/org/tb/common/jsptags/FormatLocalDateTimeTag.java index 14322b421..d348ec908 100644 --- a/src/main/java/org/tb/common/jsptags/FormatLocalDateTimeTag.java +++ b/src/main/java/org/tb/common/jsptags/FormatLocalDateTimeTag.java @@ -2,9 +2,9 @@ import java.io.IOException; import java.time.LocalDateTime; -import jakarta.servlet.jsp.JspException; -import jakarta.servlet.jsp.JspWriter; -import jakarta.servlet.jsp.tagext.TagSupport; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import javax.servlet.jsp.tagext.TagSupport; import lombok.Setter; import org.tb.common.util.DateUtils; diff --git a/src/main/java/org/tb/common/jsptags/FormatYearMonthTag.java b/src/main/java/org/tb/common/jsptags/FormatYearMonthTag.java index e9740418b..da3182535 100644 --- a/src/main/java/org/tb/common/jsptags/FormatYearMonthTag.java +++ b/src/main/java/org/tb/common/jsptags/FormatYearMonthTag.java @@ -3,9 +3,9 @@ import java.io.IOException; import java.time.LocalDate; import java.time.YearMonth; -import jakarta.servlet.jsp.JspException; -import jakarta.servlet.jsp.JspWriter; -import jakarta.servlet.jsp.tagext.TagSupport; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import javax.servlet.jsp.tagext.TagSupport; import lombok.Setter; import org.tb.common.util.DateUtils; diff --git a/src/main/java/org/tb/common/jsptags/TreeTag.java b/src/main/java/org/tb/common/jsptags/TreeTag.java index 2bfe226ec..aebf0a5a8 100644 --- a/src/main/java/org/tb/common/jsptags/TreeTag.java +++ b/src/main/java/org/tb/common/jsptags/TreeTag.java @@ -9,8 +9,8 @@ import java.util.List; import java.util.Objects; import java.util.Random; -import jakarta.servlet.jsp.JspWriter; -import jakarta.servlet.jsp.tagext.TagSupport; +import javax.servlet.jsp.JspWriter; +import javax.servlet.jsp.tagext.TagSupport; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.tb.common.GlobalConstants; diff --git a/src/main/java/org/tb/common/struts/DelegatingRequestProcessor.java b/src/main/java/org/tb/common/struts/DelegatingRequestProcessor.java index 384bcb968..934e88177 100644 --- a/src/main/java/org/tb/common/struts/DelegatingRequestProcessor.java +++ b/src/main/java/org/tb/common/struts/DelegatingRequestProcessor.java @@ -1,7 +1,7 @@ package org.tb.common.struts; import java.io.IOException; -import jakarta.servlet.ServletException; +import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import lombok.SneakyThrows; diff --git a/src/main/java/org/tb/common/struts/TypedAction.java b/src/main/java/org/tb/common/struts/TypedAction.java index 3986fc6d5..dd3ef1ee2 100644 --- a/src/main/java/org/tb/common/struts/TypedAction.java +++ b/src/main/java/org/tb/common/struts/TypedAction.java @@ -2,6 +2,8 @@ import static org.apache.struts.action.ActionMessages.GLOBAL_MESSAGE; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; diff --git a/src/main/java/org/tb/common/util/UrlUtils.java b/src/main/java/org/tb/common/util/UrlUtils.java index e5341e4ed..4ac6a2f6b 100644 --- a/src/main/java/org/tb/common/util/UrlUtils.java +++ b/src/main/java/org/tb/common/util/UrlUtils.java @@ -1,6 +1,6 @@ package org.tb.common.util; -import jakarta.servlet.ServletContext; +import javax.servlet.ServletContext; import lombok.experimental.UtilityClass; @UtilityClass diff --git a/src/main/java/org/tb/customer/CustomerRepository.java b/src/main/java/org/tb/customer/CustomerRepository.java index 4f2e013e4..cd324a409 100644 --- a/src/main/java/org/tb/customer/CustomerRepository.java +++ b/src/main/java/org/tb/customer/CustomerRepository.java @@ -2,11 +2,14 @@ import java.util.List; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; +import org.tb.employee.domain.Employeecontract; @Repository -public interface CustomerRepository extends PagingAndSortingRepository { +public interface CustomerRepository extends PagingAndSortingRepository, + CrudRepository { @Query("select c from Customer c where upper(c.id) like upper(:filter) or upper(c.name) like upper(:filter) " + "or upper(c.address) like upper(:filter) or upper(c.shortname) like upper(:filter) order by c.name asc") diff --git a/src/main/java/org/tb/dailyreport/action/ShowDailyReportAction.java b/src/main/java/org/tb/dailyreport/action/ShowDailyReportAction.java index c68200ccc..3c231f133 100644 --- a/src/main/java/org/tb/dailyreport/action/ShowDailyReportAction.java +++ b/src/main/java/org/tb/dailyreport/action/ShowDailyReportAction.java @@ -35,7 +35,7 @@ import java.util.stream.Collectors; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import jakarta.servlet.http.HttpSession; +import javax.servlet.http.HttpSession; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.struts.action.ActionForward; diff --git a/src/main/java/org/tb/dailyreport/viewhelper/VacationViewer.java b/src/main/java/org/tb/dailyreport/viewhelper/VacationViewer.java index 8608d05e4..3bec30e06 100644 --- a/src/main/java/org/tb/dailyreport/viewhelper/VacationViewer.java +++ b/src/main/java/org/tb/dailyreport/viewhelper/VacationViewer.java @@ -12,7 +12,7 @@ import java.time.LocalDate; import java.util.ArrayList; import java.util.List; -import jakarta.servlet.http.HttpSession; +import javax.servlet.http.HttpSession; import org.tb.common.util.DurationUtils; import org.tb.dailyreport.persistence.TimereportDAO; import org.tb.employee.domain.Employeecontract; diff --git a/src/main/java/org/tb/employee/persistence/EmployeeRepository.java b/src/main/java/org/tb/employee/persistence/EmployeeRepository.java index d04451fd0..e04059d9e 100644 --- a/src/main/java/org/tb/employee/persistence/EmployeeRepository.java +++ b/src/main/java/org/tb/employee/persistence/EmployeeRepository.java @@ -2,12 +2,15 @@ import java.util.Optional; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; import org.tb.employee.domain.Employee; +import org.tb.employee.domain.Employeecontract; @Repository -public interface EmployeeRepository extends PagingAndSortingRepository, JpaSpecificationExecutor { +public interface EmployeeRepository extends PagingAndSortingRepository, + CrudRepository, JpaSpecificationExecutor { Optional findBySign(String sign); diff --git a/src/main/java/org/tb/employee/persistence/EmployeecontractRepository.java b/src/main/java/org/tb/employee/persistence/EmployeecontractRepository.java index 46281d365..a487b00d8 100644 --- a/src/main/java/org/tb/employee/persistence/EmployeecontractRepository.java +++ b/src/main/java/org/tb/employee/persistence/EmployeecontractRepository.java @@ -5,12 +5,14 @@ import java.util.Optional; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; import org.tb.employee.domain.Employeecontract; @Repository public interface EmployeecontractRepository extends PagingAndSortingRepository, + CrudRepository , JpaSpecificationExecutor { @Query("select e from Employeecontract e where e.employee.id = :employeeId and e.validFrom <= :validAt and (e.validUntil >= :validAt or e.validUntil is null)") diff --git a/src/main/java/org/tb/employee/persistence/OvertimeRepository.java b/src/main/java/org/tb/employee/persistence/OvertimeRepository.java index 0afd90c6b..c1c43e57a 100644 --- a/src/main/java/org/tb/employee/persistence/OvertimeRepository.java +++ b/src/main/java/org/tb/employee/persistence/OvertimeRepository.java @@ -1,12 +1,15 @@ package org.tb.employee.persistence; import java.util.List; +import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; +import org.tb.employee.domain.Employeecontract; import org.tb.employee.domain.Overtime; @Repository -public interface OvertimeRepository extends PagingAndSortingRepository { +public interface OvertimeRepository extends PagingAndSortingRepository, + CrudRepository { List findAllByEmployeecontractId(long employeeContractId); diff --git a/src/main/java/org/tb/invoice/ExcelArchivierer.java b/src/main/java/org/tb/invoice/ExcelArchivierer.java index 14b9c1c56..91995ffdc 100644 --- a/src/main/java/org/tb/invoice/ExcelArchivierer.java +++ b/src/main/java/org/tb/invoice/ExcelArchivierer.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Map.Entry; import jakarta.annotation.Nonnull; -import jakarta.servlet.ServletOutputStream; +import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.poi.hssf.usermodel.HSSFDataFormatter; diff --git a/src/main/java/org/tb/order/persistence/CustomerorderRepository.java b/src/main/java/org/tb/order/persistence/CustomerorderRepository.java index bce17de45..ae7542203 100644 --- a/src/main/java/org/tb/order/persistence/CustomerorderRepository.java +++ b/src/main/java/org/tb/order/persistence/CustomerorderRepository.java @@ -5,12 +5,15 @@ import java.util.Optional; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; +import org.tb.employee.domain.Employeecontract; import org.tb.order.domain.Customerorder; @Repository public interface CustomerorderRepository extends PagingAndSortingRepository, + CrudRepository, JpaSpecificationExecutor { @Query("select c from Customerorder c where c.responsible_hbt.id = :responsibleHbtId") diff --git a/src/main/java/org/tb/order/viewhelper/SuborderHelper.java b/src/main/java/org/tb/order/viewhelper/SuborderHelper.java index 6b2a76439..a1bc5e9a6 100644 --- a/src/main/java/org/tb/order/viewhelper/SuborderHelper.java +++ b/src/main/java/org/tb/order/viewhelper/SuborderHelper.java @@ -6,7 +6,7 @@ import java.util.List; import java.util.Objects; import javax.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpSession; +import javax.servlet.http.HttpSession; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/tb/reporting/persistence/ReportDefinitionRepository.java b/src/main/java/org/tb/reporting/persistence/ReportDefinitionRepository.java index b5e4b157b..0334e3b83 100644 --- a/src/main/java/org/tb/reporting/persistence/ReportDefinitionRepository.java +++ b/src/main/java/org/tb/reporting/persistence/ReportDefinitionRepository.java @@ -1,10 +1,13 @@ package org.tb.reporting.persistence; +import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; +import org.tb.employee.domain.Employeecontract; import org.tb.reporting.domain.ReportDefinition; @Repository -public interface ReportDefinitionRepository extends PagingAndSortingRepository { +public interface ReportDefinitionRepository extends PagingAndSortingRepository, + CrudRepository { }