[JAVA-28961] Upgrade to spring-boot-data-2 module to Spring Boot 3 (#15620)

This commit is contained in:
Amit Pandey 2024-01-23 03:41:26 +05:30 committed by GitHub
parent b6c126b183
commit 790334d094
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 32 additions and 30 deletions

View File

@ -6,9 +6,10 @@
<artifactId>spring-boot-data-2</artifactId>
<parent>
<groupId>com.baeldung.spring-boot-modules</groupId>
<artifactId>spring-boot-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<groupId>com.baeldung</groupId>
<artifactId>parent-boot-3</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../parent-boot-3</relativePath>
</parent>
<dependencies>
@ -42,6 +43,7 @@
<properties>
<javers.version>6.6.5</javers.version>
<start-class> com.baeldung.boot.bootstrapmode.Application</start-class>
</properties>
</project>

View File

@ -1,9 +1,9 @@
package com.baeldung.boot.bootstrapmode.domain;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
@Entity
public class Todo {

View File

@ -1,8 +1,8 @@
package com.baeldung.boot.readonlyrepository;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
@Entity
public class Book

View File

@ -10,8 +10,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
@Constraint(validatedBy = { ContactInfoValidator.class })
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })

View File

@ -9,8 +9,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.thymeleaf.util.StringUtils;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import java.util.regex.Pattern;
public class ContactInfoValidator implements ConstraintValidator<ContactInfo, String> {

View File

@ -1,6 +1,6 @@
package com.baeldung.dynamicvalidation;
import javax.annotation.security.RolesAllowed;
import jakarta.annotation.security.RolesAllowed;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@ -1,6 +1,6 @@
package com.baeldung.dynamicvalidation.config;
import javax.validation.Valid;
import jakarta.validation.Valid;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;

View File

@ -1,8 +1,8 @@
package com.baeldung.dynamicvalidation.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
@Entity
public class ContactInfoExpression {

View File

@ -1,10 +1,10 @@
package com.baeldung.dynamicvalidation.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.validation.constraints.NotNull;
import com.baeldung.dynamicvalidation.ContactInfo;

View File

@ -1,6 +1,6 @@
package com.baeldung.javers.domain;
import javax.persistence.Embeddable;
import jakarta.persistence.Embeddable;
@Embeddable
public class Address {

View File

@ -1,6 +1,6 @@
package com.baeldung.javers.domain;
import javax.persistence.*;
import jakarta.persistence.*;
@Entity
public class Product {

View File

@ -1,6 +1,6 @@
package com.baeldung.javers.domain;
import javax.persistence.*;
import jakarta.persistence.*;
import java.util.ArrayList;
import java.util.List;

View File

@ -17,13 +17,13 @@ import com.baeldung.propertyeditor.exotictype.model.ExoticType;
public class PropertyEditorRestController {
@GetMapping(value = "/credit-card/{card-no}",
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
produces = MediaType.APPLICATION_JSON_VALUE )
public CreditCard parseCreditCardNumber(@PathVariable("card-no") CreditCard creditCard) {
return creditCard;
}
@GetMapping(value = "/exotic-type/{value}",
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
produces = MediaType.APPLICATION_JSON_VALUE )
public ExoticType parseExoticType(@PathVariable("value") ExoticType exoticType) {
return exoticType;
}

View File

@ -15,7 +15,7 @@ public class CreditCardEditor extends PropertyEditorSupport {
@Override
public void setAsText(String text) throws IllegalArgumentException {
if (StringUtils.isEmpty(text)) {
if (!StringUtils.hasLength(text)) {
setValue(null);
} else {
CreditCard creditCard = new CreditCard();