Skip to content

Commit 24d6538

Browse files
committed
chore: create a sample with oracle nosql database
Signed-off-by: Otavio Santana <[email protected]>
1 parent 9ae7717 commit 24d6538

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/main/java/com/otaviojava/demos/ddd/App.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
import jakarta.enterprise.inject.se.SeContainerInitializer;
1818
import net.datafaker.Faker;
1919
import net.datafaker.providers.base.Commerce;
20-
import org.eclipse.jnosql.mapping.Database;
2120
import org.eclipse.jnosql.mapping.DatabaseQualifier;
22-
import org.eclipse.jnosql.mapping.Databases;
2321

2422
import java.util.List;
2523
import java.util.Set;
@@ -40,7 +38,7 @@ public static void main(String[] args) {
4038
new Category("category2", "description2"));
4139
Commerce commerce = faker.commerce();
4240
Product product = new ProductBuilder()
43-
.id(UUID.randomUUID().toString())
41+
.id(UUID.randomUUID())
4442
.name(commerce.productName())
4543
.manufacturer(manufacturer)
4644
.tags(List.of("tag1", "tag2"))

src/main/java/com/otaviojava/demos/ddd/Product.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
public class Product {
1414

1515
@Id
16-
private String id;
16+
private UUID id;
1717

1818
@Column
1919
private String name;
@@ -33,7 +33,7 @@ public class Product {
3333
Product() {
3434
}
3535

36-
Product(String id, String name,
36+
Product(UUID id, String name,
3737
Manufacturer manufacturer,
3838
List<String> tags,
3939
Set<Category> categories) {
@@ -44,7 +44,7 @@ public class Product {
4444
this.categories = categories;
4545
}
4646

47-
public String getId() {
47+
public UUID getId() {
4848
return id;
4949
}
5050

src/main/java/com/otaviojava/demos/ddd/ProductBuilder.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
import java.util.List;
44
import java.util.Set;
5+
import java.util.UUID;
56

67
public class ProductBuilder {
7-
private String id;
8+
private UUID id;
89
private String name;
910
private Manufacturer manufacturer;
1011
private List<String> tags;
1112
private Set<Category> categories;
1213

13-
public ProductBuilder id(String id) {
14+
public ProductBuilder id(UUID id) {
1415
this.id = id;
1516
return this;
1617
}

target/classes/META-INF/microprofile-config.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# You may elect to redistribute this code under either of these licenses.
1010
#
1111

12-
jnosql.arangodb.host=localhost:8529
13-
jnosql.document.database=products
12+
1413
jnosql.keyvalue.database=products
14+
jnosql.document.database=products
15+
jnosql.oracle.nosql.host=http://localhost:8080

0 commit comments

Comments
 (0)