File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
src/main/java/org/soujava/demos/arangodb/document Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 15
15
import jakarta .enterprise .inject .se .SeContainer ;
16
16
import jakarta .enterprise .inject .se .SeContainerInitializer ;
17
17
import net .datafaker .Faker ;
18
- import net .datafaker .providers .base .Aws ;
19
- import net .datafaker .providers .base .Azure ;
18
+ import org .eclipse .jnosql .mapping .document .DocumentTemplate ;
19
+
20
+ import java .util .List ;
21
+ import java .util .logging .Logger ;
20
22
21
23
22
24
public class App {
23
25
24
- public static void main ( String [] args ) {
26
+ private static final Logger LOGGER = Logger . getLogger ( App . class . getName ());
25
27
28
+ public static void main (String [] args ) {
29
+ var faker = new Faker ();
30
+ LOGGER .info ("Starting the application" );
26
31
try (SeContainer container = SeContainerInitializer .newInstance ().initialize ()) {
27
- var faker = new Faker ();
28
- Aws aws = faker .aws ();
29
- Azure azure = faker .azure ();
30
-
32
+ var template = container .select (DocumentTemplate .class ).get ();
33
+ LOGGER .info ("Creating 10 documents" );
34
+ for (int index = 0 ; index < 5 ; index ++) {
35
+ template .insert (List .of (AWSCloudProvider .of (faker ), AzureCloudProvider .of (faker )));
36
+ }
37
+ template .select (CloudProvider .class ).stream ().forEach (System .out ::println );
31
38
}
32
39
}
33
40
You can’t perform that action at this time.
0 commit comments