File tree Expand file tree Collapse file tree 2 files changed +73
-0
lines changed
src/main/java/org/soujava/demos/arangodb/keyvalue Expand file tree Collapse file tree 2 files changed +73
-0
lines changed Original file line number Diff line number Diff line change
1
+ package org .soujava .demos .arangodb .keyvalue ;
2
+
3
+ import jakarta .nosql .Column ;
4
+ import jakarta .nosql .Entity ;
5
+ import jakarta .nosql .Id ;
6
+
7
+ import java .util .Objects ;
8
+
9
+ @ Entity
10
+ public class Airport {
11
+
12
+ @ Id
13
+ private String code ;
14
+
15
+ @ Column
16
+ private String name ;
17
+
18
+
19
+ public String getCode () {
20
+ return code ;
21
+ }
22
+
23
+ public String getName () {
24
+ return name ;
25
+ }
26
+
27
+
28
+ @ Override
29
+ public boolean equals (Object o ) {
30
+ if (o == null || getClass () != o .getClass ()) {
31
+ return false ;
32
+ }
33
+ Airport airport = (Airport ) o ;
34
+ return Objects .equals (code , airport .code );
35
+ }
36
+
37
+ @ Override
38
+ public int hashCode () {
39
+ return Objects .hashCode (code );
40
+ }
41
+
42
+ @ Override
43
+ public String toString () {
44
+ return "Airport{" +
45
+ "code='" + code + '\'' +
46
+ ", name='" + name + '\'' +
47
+ '}' ;
48
+ }
49
+ }
Original file line number Diff line number Diff line change
1
+ package org .soujava .demos .arangodb .keyvalue ;
2
+
3
+ import jakarta .enterprise .inject .se .SeContainer ;
4
+ import jakarta .enterprise .inject .se .SeContainerInitializer ;
5
+ import net .datafaker .Faker ;
6
+ import net .datafaker .providers .entertainment .DragonBall ;
7
+
8
+ public class App {
9
+
10
+ public static void main (String [] args ) {
11
+ Faker faker = new Faker ();
12
+ faker .aviation ()
13
+ try (SeContainer container = SeContainerInitializer .newInstance ().initialize ()) {
14
+ Villain lock = new Villain ();
15
+ lock .setId ("lock" );
16
+ lock .setName ("Lock" );
17
+
18
+ VillainService service = container .select (VillainService .class ).get ();
19
+ service .put (lock );
20
+ System .out .println (service .get ("lock" ));
21
+
22
+ }
23
+ }
24
+ }
You can’t perform that action at this time.
0 commit comments