|
1 | 1 | package org.springframework.data.jpa.domain.sample;
|
2 | 2 |
|
3 |
| -import lombok.Data; |
4 |
| - |
5 |
| -import java.io.Serializable; |
6 |
| - |
7 | 3 | import jakarta.persistence.Entity;
|
8 | 4 | import jakarta.persistence.Id;
|
9 | 5 | import jakarta.persistence.IdClass;
|
10 | 6 | import jakarta.persistence.ManyToOne;
|
11 | 7 |
|
| 8 | +import java.io.Serializable; |
| 9 | + |
12 | 10 | /**
|
13 | 11 | * Sample class for integration testing
|
14 | 12 | * {@link org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation}.
|
|
17 | 15 | */
|
18 | 16 | @Entity
|
19 | 17 | @IdClass(SampleWithIdClassIncludingEntity.SampleWithIdClassPK.class)
|
20 |
| -@Data |
21 | 18 | public class SampleWithIdClassIncludingEntity {
|
22 | 19 |
|
23 | 20 | @Id Long first;
|
24 |
| - @ManyToOne @Id OtherEntity second; |
| 21 | + @ManyToOne |
| 22 | + @Id OtherEntity second; |
| 23 | + |
| 24 | + public SampleWithIdClassIncludingEntity() {} |
| 25 | + |
| 26 | + public Long getFirst() { |
| 27 | + return this.first; |
| 28 | + } |
| 29 | + |
| 30 | + public OtherEntity getSecond() { |
| 31 | + return this.second; |
| 32 | + } |
| 33 | + |
| 34 | + public void setFirst(Long first) { |
| 35 | + this.first = first; |
| 36 | + } |
| 37 | + |
| 38 | + public void setSecond(OtherEntity second) { |
| 39 | + this.second = second; |
| 40 | + } |
| 41 | + |
| 42 | + public String toString() { |
| 43 | + return "SampleWithIdClassIncludingEntity(first=" + this.getFirst() + ", second=" + this.getSecond() + ")"; |
| 44 | + } |
25 | 45 |
|
26 |
| - @Data |
27 | 46 | @SuppressWarnings("serial")
|
28 | 47 | public static class SampleWithIdClassPK implements Serializable {
|
29 | 48 |
|
30 | 49 | Long first;
|
31 | 50 | Long second;
|
| 51 | + |
| 52 | + public SampleWithIdClassPK() {} |
| 53 | + |
| 54 | + public Long getFirst() { |
| 55 | + return this.first; |
| 56 | + } |
| 57 | + |
| 58 | + public Long getSecond() { |
| 59 | + return this.second; |
| 60 | + } |
| 61 | + |
| 62 | + public void setFirst(Long first) { |
| 63 | + this.first = first; |
| 64 | + } |
| 65 | + |
| 66 | + public void setSecond(Long second) { |
| 67 | + this.second = second; |
| 68 | + } |
| 69 | + |
| 70 | + public String toString() { |
| 71 | + return "SampleWithIdClassIncludingEntity.SampleWithIdClassPK(first=" + this.getFirst() + ", second=" |
| 72 | + + this.getSecond() + ")"; |
| 73 | + } |
32 | 74 | }
|
33 | 75 |
|
34 | 76 | @Entity
|
35 |
| - @Data |
36 | 77 | public static class OtherEntity {
|
37 | 78 | @Id Long otherId;
|
| 79 | + |
| 80 | + public OtherEntity() {} |
| 81 | + |
| 82 | + public Long getOtherId() { |
| 83 | + return this.otherId; |
| 84 | + } |
| 85 | + |
| 86 | + public void setOtherId(Long otherId) { |
| 87 | + this.otherId = otherId; |
| 88 | + } |
| 89 | + |
| 90 | + public String toString() { |
| 91 | + return "SampleWithIdClassIncludingEntity.OtherEntity(otherId=" + this.getOtherId() + ")"; |
| 92 | + } |
38 | 93 | }
|
39 | 94 |
|
40 | 95 | /**
|
|
0 commit comments