|
20 | 20 |
|
21 | 21 | package org.omg.sysml.lifecycle.impl; |
22 | 22 |
|
23 | | -import com.fasterxml.jackson.annotation.JsonGetter; |
24 | 23 | import com.fasterxml.jackson.annotation.JsonProperty; |
25 | | -import com.fasterxml.jackson.annotation.JsonSetter; |
26 | 24 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
27 | 25 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
28 | 26 | import jackson.RecordSerialization; |
|
32 | 30 | import org.omg.sysml.record.impl.RecordImpl; |
33 | 31 |
|
34 | 32 | import javax.persistence.*; |
| 33 | +import javax.validation.constraints.NotNull; |
35 | 34 | import java.time.ZonedDateTime; |
36 | 35 |
|
37 | 36 | @Entity(name = "Tag") |
38 | 37 | public class TagImpl extends RecordImpl implements Tag { |
39 | 38 | private Project owningProject; |
40 | 39 | private Commit taggedCommit; |
41 | | - private String name; |
42 | 40 | private ZonedDateTime created; |
43 | 41 |
|
| 42 | + @Override |
| 43 | + @JsonProperty(required = true) |
| 44 | + public @NotNull String getName() { |
| 45 | + return super.getName(); |
| 46 | + } |
| 47 | + |
| 48 | + @Override |
| 49 | + @JsonProperty(required = true) |
| 50 | + public void setName(@NotNull String name) { |
| 51 | + super.setName(name); |
| 52 | + } |
| 53 | + |
44 | 54 | @Override |
45 | 55 | @ManyToOne(targetEntity = ProjectImpl.class, fetch = FetchType.LAZY) |
46 | 56 | @JsonSerialize(as = ProjectImpl.class, using = RecordSerialization.RecordSerializer.class) |
@@ -71,21 +81,6 @@ public Commit getReferencedCommit() { |
71 | 81 | return Tag.super.getReferencedCommit(); |
72 | 82 | } |
73 | 83 |
|
74 | | - @JsonProperty(required = true) |
75 | | - @JsonGetter |
76 | | - @Lob |
77 | | - @org.hibernate.annotations.Type(type = "org.hibernate.type.TextType") |
78 | | - @Column(name = "name", table = "Tag") |
79 | | - public String getName() { |
80 | | - return name; |
81 | | - } |
82 | | - |
83 | | - @JsonProperty(required = true) |
84 | | - @JsonSetter |
85 | | - public void setName(String name) { |
86 | | - this.name = name; |
87 | | - } |
88 | | - |
89 | 84 | @Override |
90 | 85 | @Column |
91 | 86 | public ZonedDateTime getCreated() { |
|
0 commit comments