You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.adoc
+94-4Lines changed: 94 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -390,7 +390,6 @@ jnosql.couchbase.user=root
390
390
jnosql.couchbase.password=123456
391
391
----
392
392
393
-
394
393
The config settings are the default behavior; nevertheless, there is an option to do it programmatically. Create a class that implements the `Supplier<CouchbaseDocumentManager>` and then defines it as an `@Alternative` and the `Priority`.
https://aws.amazon.com/dynamodb/[Amazon DynamoDB] is a fully managed, serverless, key-value NoSQL database designed to run high-performance applications at any scale. DynamoDB offers built-in security, continuous backups, automated multi-Region replication, in-memory caching, and data import and export tools.
521
+
https://aws.amazon.com/dynamodb/[Amazon DynamoDB] is a fully managed, serverless, key-value and document NoSQL database designed to run high-performance applications at any scale. DynamoDB offers built-in security, continuous backups, automated multi-Region replication, in-memory caching, and data import and export tools.
523
522
524
-
This driver provides support for the *Key-Value* NoSQL API.
523
+
This driver has support for two NoSQL API types: *Key-Value* and *Document*.
525
524
526
525
=== How To Install
527
526
@@ -539,6 +538,7 @@ You can use either the Maven or Gradle dependencies:
539
538
=== Configuration
540
539
541
540
This API provides the ```DynamoDBConfigurations``` class to programmatically establish the credentials.
541
+
542
542
Please note that you can establish properties using the https://microprofile.io/microprofile-config/[MicroProfile Config] specification.
543
543
544
544
[cols="DynamoDB"]
@@ -560,9 +560,10 @@ Please note that you can establish properties using the https://microprofile.io/
560
560
|`jnosql.dynamodb.secretaccess`
561
561
|The AWS secret access key, used to authenticate the user interacting with AWS.
562
562
563
-
564
563
|===
565
564
565
+
=== Using the Key-value API
566
+
566
567
This is an example using DynamoDB's Key-Value API with MicroProfile Config.
The DynamoDB's Document API implementation follows the *SINGLE TABLE* strategy, it means, the table will store multiple entity types. To satisfy this strategy, the implementation assumes that the target table will have a composed primary key:
578
+
579
+
- The `entityType` field as the partitioning key;
580
+
- The `id` field as the sort key;
581
+
582
+
To customize the partitioning key field name, you can define the following configuration
583
+
584
+
[source,properties]
585
+
----
586
+
jnosql.dynamodb.entity.pk=entityType
587
+
----
588
+
589
+
By default, the implementation doesn't create the table on-the-fly, letting this requirement for the users. If you prefer, the implementation is able to create the table on-the-fly as well. To activate this capability you should define explicitly the following configuration:
590
+
591
+
[source,properties]
592
+
----
593
+
jnosql.dynamodb.create.tables=true
594
+
----
595
+
596
+
The table will be created with the composed primary key mentioned previously.
597
+
598
+
Here's an example using DynamoDB's Document API with MicroProfile Config.
The config settings are the default behavior; nevertheless, there is an option to do it programmatically. Create a class that implements the `Supplier<DynamoDBDocumentManager>` and then defines it as an `@Alternative` and the `Priority`.
607
+
608
+
[source,java]
609
+
----
610
+
@ApplicationScoped
611
+
@Alternative
612
+
@Priority(Interceptor.Priority.APPLICATION)
613
+
public class ManagerSupplier implements Supplier<DynamoDBDocumentManager> {
The ```DynamoDBRepository``` interface is an extension of the ```Repository``` interface that allows execution of PartiQL via the ```@PartiQL``` annotation.
0 commit comments