File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020# Go workspace file
2121go.work
2222.idea /
23- .id2 /
2423
Original file line number Diff line number Diff line change @@ -54,28 +54,42 @@ import org.bson.codecs.pojo.annotations.BsonProperty;
5454/**
5555 The org person
5656**/
57- class OrgPerson {
57+ entity OrgPerson {
5858
59- data String uuid as u = Utils.newUID();
59+ index (uuid asc) unique;
60+ index (name asc) unique;
61+ index (email asc) unique sparse;
62+ index (friendIds asc) sparse;
63+
64+ data String uuid as u = ~Utils.newUID()~;
6065
6166 data String orgId as o;
6267
6368 data String name as n;
6469
6570 data String email as e;
6671
67- }
72+ data Status status as st = ~Status.PENDING~;
73+
74+ data ~List<String>~ friendIds as f = ~new ArrayList<>()~;
75+
76+ data ~List<Address>~ addresses as a = ~new ArrayList<>()~;
77+
78+ ...
6879
6980```
7081
71- The output is: [ output java] ( internal/sample_output .java)
82+ The output is: [ output java] ( samples/sample_input .java)
7283
7384```
7485 Usage of the output class:
7586
7687 var org = OrgPerson.builder().setOrgId("45").setName("test").build();
88+
89+ // Update the org. Note the original is not modified.
7790 var orgUpdate = org.copy().setName("newName").build();
7891
92+
7993```
8094
8195# Examples
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments