diff --git a/spring-data-envers/src/test/java/org/springframework/data/envers/sample/QCountry.java b/spring-data-envers/src/test/java/org/springframework/data/envers/sample/QCountry.java index c7269cab3d..66a3d509b9 100755 --- a/spring-data-envers/src/test/java/org/springframework/data/envers/sample/QCountry.java +++ b/spring-data-envers/src/test/java/org/springframework/data/envers/sample/QCountry.java @@ -23,6 +23,8 @@ import static com.querydsl.core.types.PathMetadataFactory.forVariable; +import java.io.Serial; + /** * Query class for Country domain. * @@ -30,7 +32,7 @@ */ public class QCountry extends EntityPathBase { - private static final long serialVersionUID = -936338527; + @Serial private static final long serialVersionUID = -936338527; private static final PathInits INITS = PathInits.DIRECT2; diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/JpaSort.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/JpaSort.java index a844135fd0..e1fa003384 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/JpaSort.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/JpaSort.java @@ -22,6 +22,7 @@ import org.springframework.lang.Nullable; import org.springframework.util.Assert; +import java.io.Serial; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -39,7 +40,7 @@ */ public class JpaSort extends Sort { - private static final long serialVersionUID = 1L; + @Serial private static final long serialVersionUID = 1L; private JpaSort(Direction direction, List> paths) { this(Collections.emptyList(), direction, paths); @@ -316,7 +317,7 @@ public String toString() { */ public static class JpaOrder extends Order { - private static final long serialVersionUID = 1L; + @Serial private static final long serialVersionUID = 1L; private final boolean unsafe; diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/Specification.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/Specification.java index 462a02ea77..32c84faae9 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/Specification.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/Specification.java @@ -20,6 +20,7 @@ import jakarta.persistence.criteria.Predicate; import jakarta.persistence.criteria.Root; +import java.io.Serial; import java.io.Serializable; import java.util.Arrays; import java.util.stream.StreamSupport; @@ -40,7 +41,7 @@ */ public interface Specification extends Serializable { - long serialVersionUID = 1L; + @Serial long serialVersionUID = 1L; /** * Negates the given {@link Specification}. diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/InvalidJpaQueryMethodException.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/InvalidJpaQueryMethodException.java index a70c4beb29..5662d7d091 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/InvalidJpaQueryMethodException.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/InvalidJpaQueryMethodException.java @@ -15,6 +15,8 @@ */ package org.springframework.data.jpa.repository.query; +import java.io.Serial; + /** * Signals that we encountered an invalid query method. * @@ -23,7 +25,7 @@ */ public class InvalidJpaQueryMethodException extends RuntimeException { - private static final long serialVersionUID = 1L; + @Serial private static final long serialVersionUID = 1L; /** * Creates a new {@link InvalidJpaQueryMethodException} with the given message. diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java index 063093858f..b47b502b4f 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java @@ -31,6 +31,7 @@ import jakarta.persistence.criteria.Predicate; import jakarta.persistence.criteria.Root; +import java.io.Serial; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -952,7 +953,7 @@ private static long executeCountQuery(TypedQuery query) { @SuppressWarnings("rawtypes") private static final class ByIdsSpecification implements Specification { - private static final long serialVersionUID = 1L; + @Serial private static final long serialVersionUID = 1L; private final JpaEntityInformation entityInformation; @@ -981,7 +982,7 @@ public Predicate toPredicate(Root root, CriteriaQuery query, CriteriaBuild */ private static class ExampleSpecification implements Specification { - private static final long serialVersionUID = 1L; + @Serial private static final long serialVersionUID = 1L; private final Example example; private final EscapeCharacter escapeCharacter; diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/Account.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/Account.java index 9b0fcbb036..e297d3ab5b 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/Account.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/Account.java @@ -15,6 +15,8 @@ */ package org.springframework.data.jpa.domain.sample; +import java.io.Serial; + import jakarta.persistence.Entity; import org.springframework.data.jpa.domain.AbstractPersistable; diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/EmbeddedIdExampleEmployeePK.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/EmbeddedIdExampleEmployeePK.java index f492e758ec..1b5e49bef7 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/EmbeddedIdExampleEmployeePK.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/EmbeddedIdExampleEmployeePK.java @@ -15,6 +15,7 @@ */ package org.springframework.data.jpa.domain.sample; +import java.io.Serial; import java.io.Serializable; import jakarta.persistence.Column; @@ -25,7 +26,7 @@ */ @Embeddable public class EmbeddedIdExampleEmployeePK implements Serializable { - private static final long serialVersionUID = 1L; + @Serial private static final long serialVersionUID = 1L; @Column(nullable = false) private Long employeeId; diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/IdClassExampleEmployeePK.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/IdClassExampleEmployeePK.java index 094f965554..142c75b5f9 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/IdClassExampleEmployeePK.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/IdClassExampleEmployeePK.java @@ -15,13 +15,14 @@ */ package org.springframework.data.jpa.domain.sample; +import java.io.Serial; import java.io.Serializable; /** * @author Thomas Darimont */ public class IdClassExampleEmployeePK implements Serializable { - private static final long serialVersionUID = 1L; + @Serial private static final long serialVersionUID = 1L; private long empId; private long department; diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/ItemId.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/ItemId.java index 3d65578cce..27b5417af1 100755 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/ItemId.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/ItemId.java @@ -15,6 +15,7 @@ */ package org.springframework.data.jpa.domain.sample; +import java.io.Serial; import java.io.Serializable; /** @@ -25,7 +26,7 @@ */ public class ItemId implements Serializable { - private static final long serialVersionUID = -2986871112875450036L; + @Serial private static final long serialVersionUID = -2986871112875450036L; private Integer id; private Integer manufacturerId; diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/ItemSiteId.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/ItemSiteId.java index 4b9f2bc159..e645fe3f4c 100755 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/ItemSiteId.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/ItemSiteId.java @@ -15,6 +15,7 @@ */ package org.springframework.data.jpa.domain.sample; +import java.io.Serial; import java.io.Serializable; /** @@ -25,7 +26,7 @@ */ public class ItemSiteId implements Serializable { - private static final long serialVersionUID = 1822540289216799357L; + @Serial private static final long serialVersionUID = 1822540289216799357L; private ItemId item; private Integer site; diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/PersistableWithIdClassPK.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/PersistableWithIdClassPK.java index 4b830e5ec4..5f7a6ffa43 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/PersistableWithIdClassPK.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/PersistableWithIdClassPK.java @@ -17,6 +17,7 @@ import static org.springframework.util.ObjectUtils.*; +import java.io.Serial; import java.io.Serializable; /** @@ -25,7 +26,7 @@ */ public class PersistableWithIdClassPK implements Serializable { - private static final long serialVersionUID = 23126782341L; + @Serial private static final long serialVersionUID = 23126782341L; private Long first; private Long second; diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/PersistableWithSingleIdClassPK.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/PersistableWithSingleIdClassPK.java index 4c90313fe8..e405b3c4ba 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/PersistableWithSingleIdClassPK.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/PersistableWithSingleIdClassPK.java @@ -17,6 +17,7 @@ import static org.springframework.util.ObjectUtils.*; +import java.io.Serial; import java.io.Serializable; /** @@ -24,7 +25,7 @@ */ public class PersistableWithSingleIdClassPK implements Serializable { - private static final long serialVersionUID = 23126782341L; + @Serial private static final long serialVersionUID = 23126782341L; private Long first; diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/SampleEntityPK.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/SampleEntityPK.java index eec8849df3..c46143f81d 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/SampleEntityPK.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/SampleEntityPK.java @@ -15,6 +15,7 @@ */ package org.springframework.data.jpa.domain.sample; +import java.io.Serial; import java.io.Serializable; import jakarta.persistence.Column; @@ -25,7 +26,7 @@ @Embeddable public class SampleEntityPK implements Serializable { - private static final long serialVersionUID = 231060947L; + @Serial private static final long serialVersionUID = 231060947L; @Column(nullable = false) private String first; diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/Site.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/Site.java index 4bc3683b95..996561cdf4 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/Site.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/Site.java @@ -15,6 +15,8 @@ */ package org.springframework.data.jpa.domain.sample; +import java.io.Serial; + import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; @@ -31,7 +33,7 @@ @Table public class Site implements java.io.Serializable { - private static final long serialVersionUID = 1L; + @Serial private static final long serialVersionUID = 1L; @Id @GeneratedValue Integer id;