Skip to content

Commit acbbe1c

Browse files
committed
SYSMOAS_-8: add description to all Record subtypes
1 parent 16c2e35 commit acbbe1c

10 files changed

Lines changed: 462 additions & 21 deletions

File tree

app/org/omg/sysml/lifecycle/impl/CommitImpl.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public class CommitImpl extends RecordImpl implements Commit {
4444
private Project owningProject;
4545
private Set<DataVersion> change;
4646
private ZonedDateTime created;
47-
private String description;
4847
private Commit previousCommit;
4948

5049
@Override
@@ -83,21 +82,6 @@ public void setCreated(ZonedDateTime created) {
8382
this.created = created;
8483
}
8584

86-
@JsonProperty(required = true)
87-
@JsonGetter
88-
@Lob
89-
@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType")
90-
@javax.persistence.Column(name = "description", table = "Commit")
91-
public String getDescription() {
92-
return description;
93-
}
94-
95-
@JsonProperty(required = true)
96-
@JsonSetter
97-
public void setDescription(String description) {
98-
this.description = description;
99-
}
100-
10185
@ManyToOne(targetEntity = CommitImpl.class, fetch = FetchType.LAZY)
10286
@JsonSerialize(as = CommitImpl.class, using = RecordSerialization.RecordSerializer.class)
10387
public Commit getPreviousCommit() {

app/org/omg/sysml/record/Record.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,9 @@ public interface Record {
3939
Set<String> getAlias();
4040

4141
void setAlias(Set<String> alias);
42+
43+
@Nullable
44+
String getDescription();
45+
46+
void setDescription(@Nullable String description);
4247
}

app/org/omg/sysml/record/impl/RecordImpl.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
package org.omg.sysml.record.impl;
2424

2525
import com.fasterxml.jackson.annotation.JsonGetter;
26+
import com.fasterxml.jackson.annotation.JsonProperty;
2627
import com.fasterxml.jackson.annotation.JsonSetter;
2728
import org.omg.sysml.record.Record;
2829

@@ -39,6 +40,7 @@ public abstract class RecordImpl implements Record {
3940
private UUID id;
4041
private String name;
4142
private Set<String> alias = new LinkedHashSet<>();
43+
private String description;
4244

4345
@Override
4446
@Id
@@ -90,4 +92,19 @@ public void setAlias(Set<String> alias) {
9092
this.alias.add(name);
9193
}
9294
}
95+
96+
@Override
97+
@JsonGetter
98+
@Lob
99+
@org.hibernate.annotations.Type(type = "org.hibernate.type.TextType")
100+
@Column(name = "description")
101+
public @Nullable String getDescription() {
102+
return description;
103+
}
104+
105+
@Override
106+
@JsonSetter
107+
public void setDescription(@Nullable String description) {
108+
this.description = description;
109+
}
93110
}

conf/json/schema/api/schemas-sans-metamodel-requests.json

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,16 @@
125125
}
126126
]
127127
},
128+
"description": {
129+
"oneOf": [
130+
{
131+
"type": "string"
132+
},
133+
{
134+
"type": "null"
135+
}
136+
]
137+
},
128138
"head": {
129139
"oneOf": [
130140
{
@@ -154,6 +164,7 @@
154164
"alias",
155165
"created",
156166
"deleted",
167+
"description",
157168
"head",
158169
"name",
159170
"owningProject",
@@ -176,6 +187,16 @@
176187
"type": "string"
177188
}
178189
},
190+
"description": {
191+
"oneOf": [
192+
{
193+
"type": "string"
194+
},
195+
{
196+
"type": "null"
197+
}
198+
]
199+
},
179200
"head": {
180201
"oneOf": [
181202
{
@@ -231,6 +252,16 @@
231252
}
232253
]
233254
},
255+
"description": {
256+
"oneOf": [
257+
{
258+
"type": "string"
259+
},
260+
{
261+
"type": "null"
262+
}
263+
]
264+
},
234265
"name": {
235266
"type": "string"
236267
},
@@ -253,6 +284,7 @@
253284
"alias",
254285
"created",
255286
"deleted",
287+
"description",
256288
"name",
257289
"owningProject",
258290
"referencedCommit",
@@ -275,6 +307,16 @@
275307
"type": "string"
276308
}
277309
},
310+
"description": {
311+
"oneOf": [
312+
{
313+
"type": "string"
314+
},
315+
{
316+
"type": "null"
317+
}
318+
]
319+
},
278320
"name": {
279321
"type": "string"
280322
},
@@ -422,6 +464,16 @@
422464
"type": "string"
423465
}
424466
},
467+
"description": {
468+
"oneOf": [
469+
{
470+
"type": "string"
471+
},
472+
{
473+
"type": "null"
474+
}
475+
]
476+
},
425477
"identity": {
426478
"$ref": "https://www.omg.org/spec/SystemsModelingAPI/20230201/DataIdentity"
427479
},
@@ -450,6 +502,7 @@
450502
"@id",
451503
"@type",
452504
"alias",
505+
"description",
453506
"identity",
454507
"name",
455508
"payload"
@@ -471,6 +524,16 @@
471524
"type": "string"
472525
}
473526
},
527+
"description": {
528+
"oneOf": [
529+
{
530+
"type": "string"
531+
},
532+
{
533+
"type": "null"
534+
}
535+
]
536+
},
474537
"identity": {
475538
"$ref": "https://www.omg.org/spec/SystemsModelingAPI/20230201/DataIdentityRequest"
476539
},
@@ -555,6 +618,16 @@
555618
"type": "string"
556619
}
557620
},
621+
"description": {
622+
"oneOf": [
623+
{
624+
"type": "string"
625+
},
626+
{
627+
"type": "null"
628+
}
629+
]
630+
},
558631
"name": {
559632
"oneOf": [
560633
{
@@ -570,6 +643,7 @@
570643
"@id",
571644
"@type",
572645
"alias",
646+
"description",
573647
"name"
574648
],
575649
"additionalProperties": false
@@ -593,6 +667,16 @@
593667
"type": "string"
594668
}
595669
},
670+
"description": {
671+
"oneOf": [
672+
{
673+
"type": "string"
674+
},
675+
{
676+
"type": "null"
677+
}
678+
]
679+
},
596680
"name": {
597681
"oneOf": [
598682
{
@@ -869,6 +953,16 @@
869953
"type": "string"
870954
}
871955
},
956+
"description": {
957+
"oneOf": [
958+
{
959+
"type": "string"
960+
},
961+
{
962+
"type": "null"
963+
}
964+
]
965+
},
872966
"name": {
873967
"type": "string"
874968
},
@@ -897,6 +991,7 @@
897991
"@id",
898992
"@type",
899993
"alias",
994+
"description",
900995
"name",
901996
"owningProject",
902997
"select",
@@ -919,6 +1014,16 @@
9191014
"type": "string"
9201015
}
9211016
},
1017+
"description": {
1018+
"oneOf": [
1019+
{
1020+
"type": "string"
1021+
},
1022+
{
1023+
"type": "null"
1024+
}
1025+
]
1026+
},
9221027
"name": {
9231028
"type": "string"
9241029
},

0 commit comments

Comments
 (0)