From 8a39e00f1d5ffd4b2e3843e37e344699741622be Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Thu, 12 Sep 2024 19:14:12 +0100 Subject: [PATCH 01/12] docs: include documentation pagination Signed-off-by: Otavio Santana --- CHANGELOG.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index bc4af6504..172fac779 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -34,6 +34,9 @@ and this project adheres to https://semver.org/spec/v2.0.0.html[Semantic Version - Remove Apache Tinkerpop from the project and move it as a driver +=== Changed + +- by default disable Cursor pagination in the `SemiStructuredTemplate` when there is more than one sort == [1.1.1] - 2023-05-25 From 2242a45497d7b18d0dba3e4599a3d9eaff15e38e Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Thu, 12 Sep 2024 19:38:05 +0100 Subject: [PATCH 02/12] feat: include configuration at jnosql Signed-off-by: Otavio Santana --- .../org/eclipse/jnosql/communication/Configurations.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/Configurations.java b/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/Configurations.java index c9581fa89..7f8e8dbcf 100644 --- a/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/Configurations.java +++ b/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/Configurations.java @@ -39,7 +39,12 @@ public enum Configurations implements Supplier { /** * A configuration to set the encryption to settings property. */ - ENCRYPTION("jakarta.nosql.settings.encryption"); + ENCRYPTION("jakarta.nosql.settings.encryption"), + + /** + * A configuration to enable cursor pagination in a NoSQL database using multiple sorting. + */ + CURSOR_PAGINATION_MULTIPLE_SORTING("org.eclipse.jnosql.pagination.cursor"); private final String configuration; @@ -52,4 +57,4 @@ public enum Configurations implements Supplier { public String get() { return configuration; } -} \ No newline at end of file +} From f4e823fc47ccb8b11be844561446dc314f47e31d Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Thu, 12 Sep 2024 19:38:24 +0100 Subject: [PATCH 03/12] feat: include logs at semistructure template Signed-off-by: Otavio Santana --- .../semistructured/AbstractSemiStructuredTemplate.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java b/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java index 872949bbe..61c956deb 100644 --- a/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java +++ b/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java @@ -44,6 +44,7 @@ import java.util.function.Consumer; import java.util.function.Function; import java.util.function.UnaryOperator; +import java.util.logging.Logger; import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.stream.StreamSupport; @@ -59,6 +60,8 @@ */ public abstract class AbstractSemiStructuredTemplate implements SemiStructuredTemplate { + private static final Logger LOGGER = Logger.getLogger(AbstractSemiStructuredTemplate.class.getName()); + private static final QueryParser PARSER = new QueryParser(); /** @@ -327,6 +330,7 @@ public void deleteAll(Class type) { public CursoredPage selectCursor(SelectQuery query, PageRequest pageRequest){ Objects.requireNonNull(query, "query is required"); Objects.requireNonNull(pageRequest, "pageRequest is required"); + LOGGER.finest(() -> "Executing query: " + query); CursoredPage cursoredPage = this.manager().selectCursor(query, pageRequest); List entities = cursoredPage.stream().map(c -> converter().toEntity(c)).toList(); PageRequest nextPageRequest = cursoredPage.hasNext()? cursoredPage.nextPageRequest() : null; From 10bcab4d36c59228a930720e89307c8fb11be13e Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Thu, 12 Sep 2024 19:38:44 +0100 Subject: [PATCH 04/12] docs: enhance documentation explaning about disable multipe sorting by default Signed-off-by: Otavio Santana --- .../communication/semistructured/DatabaseManager.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jnosql-communication/jnosql-communication-semistructured/src/main/java/org/eclipse/jnosql/communication/semistructured/DatabaseManager.java b/jnosql-communication/jnosql-communication-semistructured/src/main/java/org/eclipse/jnosql/communication/semistructured/DatabaseManager.java index 2630aa7e0..ebcb2a145 100644 --- a/jnosql-communication/jnosql-communication-semistructured/src/main/java/org/eclipse/jnosql/communication/semistructured/DatabaseManager.java +++ b/jnosql-communication/jnosql-communication-semistructured/src/main/java/org/eclipse/jnosql/communication/semistructured/DatabaseManager.java @@ -317,6 +317,15 @@ default Optional singleResult(SelectQuery query) { *

For cursor-based pagination, at least one sort field must be specified in the {@link SelectQuery} order clause; otherwise, an * {@link IllegalArgumentException} will be thrown.

* + *

By default, multiple sorting is disabled because in NoSQL databases, sorting by multiple fields can lead to unpredictable and inconsistent + * results. Unlike relational databases, which have a deterministic approach to sorting, NoSQL databases such as MongoDB may return inconsistent + * orderings when multiple fields contain duplicate values. This is due to the way NoSQL databases store and retrieve data, without strict ordering + * guarantees unless a unique field (like `_id`) is included in the sort criteria.

+ * + *

If multiple sorting is required, it can be explicitly enabled by setting the property: + * org.eclipse.jnosql.pagination.cursor=true. For additional configurations, refer to + * {@link org.eclipse.jnosql.communication.Configurations#CURSOR_PAGINATION_MULTIPLE_SORTING}.

+ * * @param query the query to retrieve entities * @param pageRequest the page request defining the cursor-based paging * @return a {@link CursoredPage} instance containing the entities within the specified page From 0ce244d5ccadb245414eae46ac9f6ffcf2fc6bbf Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Thu, 12 Sep 2024 19:55:39 +0100 Subject: [PATCH 05/12] docs: enhance documentation about disable multiple sorting Signed-off-by: Otavio Santana --- .../mapping/semistructured/SemiStructuredTemplate.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/SemiStructuredTemplate.java b/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/SemiStructuredTemplate.java index 66eafa98a..1b54f4667 100644 --- a/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/SemiStructuredTemplate.java +++ b/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/SemiStructuredTemplate.java @@ -202,6 +202,7 @@ public interface SemiStructuredTemplate extends Template { */ void deleteAll(Class type); + e /** * Select entities using pagination with cursor-based paging. * @@ -217,6 +218,14 @@ public interface SemiStructuredTemplate extends Template { *

For cursor-based pagination, at least one sort field must be specified in the {@link SelectQuery} order clause; otherwise, an * {@link IllegalArgumentException} will be thrown.

* + *

By default, multiple sorting is disabled due to the behavior of NoSQL databases. In NoSQL systems, sorting by multiple fields can result + * in unpredictable or inconsistent results, particularly when those fields contain duplicate values. Relational databases are more deterministic + * in their sorting algorithms, but NoSQL systems such as MongoDB may return results in varying order if there is no unique field, such as `_id`, + * to break ties. This behavior makes it difficult to guarantee stable pagination across requests.

+ * + *

To enable multiple sorting, set the property org.eclipse.jnosql.pagination.cursor=true. For more details, refer to + * {@link org.eclipse.jnosql.communication.Configurations#CURSOR_PAGINATION_MULTIPLE_SORTING}.

+ * * @param query the query to retrieve entities * @param pageRequest the page request defining the cursor-based paging * @param the entity type From 9b9bfdd1a8ff6a65777bafe9703c44f4f05e517c Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Thu, 12 Sep 2024 19:56:06 +0100 Subject: [PATCH 06/12] docs: update documentation at database manager Signed-off-by: Otavio Santana --- .../communication/semistructured/DatabaseManager.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/jnosql-communication/jnosql-communication-semistructured/src/main/java/org/eclipse/jnosql/communication/semistructured/DatabaseManager.java b/jnosql-communication/jnosql-communication-semistructured/src/main/java/org/eclipse/jnosql/communication/semistructured/DatabaseManager.java index ebcb2a145..2630aa7e0 100644 --- a/jnosql-communication/jnosql-communication-semistructured/src/main/java/org/eclipse/jnosql/communication/semistructured/DatabaseManager.java +++ b/jnosql-communication/jnosql-communication-semistructured/src/main/java/org/eclipse/jnosql/communication/semistructured/DatabaseManager.java @@ -317,15 +317,6 @@ default Optional singleResult(SelectQuery query) { *

For cursor-based pagination, at least one sort field must be specified in the {@link SelectQuery} order clause; otherwise, an * {@link IllegalArgumentException} will be thrown.

* - *

By default, multiple sorting is disabled because in NoSQL databases, sorting by multiple fields can lead to unpredictable and inconsistent - * results. Unlike relational databases, which have a deterministic approach to sorting, NoSQL databases such as MongoDB may return inconsistent - * orderings when multiple fields contain duplicate values. This is due to the way NoSQL databases store and retrieve data, without strict ordering - * guarantees unless a unique field (like `_id`) is included in the sort criteria.

- * - *

If multiple sorting is required, it can be explicitly enabled by setting the property: - * org.eclipse.jnosql.pagination.cursor=true. For additional configurations, refer to - * {@link org.eclipse.jnosql.communication.Configurations#CURSOR_PAGINATION_MULTIPLE_SORTING}.

- * * @param query the query to retrieve entities * @param pageRequest the page request defining the cursor-based paging * @return a {@link CursoredPage} instance containing the entities within the specified page From dc3ce89a6ad7471f050a93274ecc98cfbedc8a3a Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Thu, 12 Sep 2024 19:56:21 +0100 Subject: [PATCH 07/12] feat: create implementation to disable Signed-off-by: Otavio Santana --- .../AbstractSemiStructuredTemplate.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java b/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java index 61c956deb..0968aa775 100644 --- a/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java +++ b/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java @@ -22,6 +22,7 @@ import jakarta.data.page.impl.CursoredPageRecord; import jakarta.nosql.QueryMapper; +import org.eclipse.jnosql.communication.Configurations; import org.eclipse.jnosql.communication.semistructured.CommunicationEntity; import org.eclipse.jnosql.communication.semistructured.DatabaseManager; import org.eclipse.jnosql.communication.semistructured.DeleteQuery; @@ -30,6 +31,7 @@ import org.eclipse.jnosql.mapping.core.Converters; import org.eclipse.jnosql.mapping.IdNotFoundException; import org.eclipse.jnosql.mapping.core.NoSQLPage; +import org.eclipse.jnosql.mapping.core.config.MicroProfileSettings; import org.eclipse.jnosql.mapping.metadata.EntitiesMetadata; import org.eclipse.jnosql.mapping.metadata.EntityMetadata; import org.eclipse.jnosql.mapping.metadata.FieldMetadata; @@ -50,6 +52,7 @@ import java.util.stream.StreamSupport; import static java.util.Objects.requireNonNull; +import static org.eclipse.jnosql.communication.Configurations.CURSOR_PAGINATION_MULTIPLE_SORTING; /** * An abstract implementation of the {@link SemiStructuredTemplate} interface providing @@ -331,6 +334,14 @@ public CursoredPage selectCursor(SelectQuery query, PageRequest pageReque Objects.requireNonNull(query, "query is required"); Objects.requireNonNull(pageRequest, "pageRequest is required"); LOGGER.finest(() -> "Executing query: " + query); + var enableMultipleSorting = !MicroProfileSettings.INSTANCE.get(CURSOR_PAGINATION_MULTIPLE_SORTING, Boolean.class) + .orElse(false); + LOGGER.finest(() -> "Cursor pagination with multiple sorting is enabled: " + enableMultipleSorting); + + if (!enableMultipleSorting && query.sorts().size() > 1) { + throw new UnsupportedOperationException("Cursor pagination with multiple sorting is not supported, " + + "enable it by setting the property " + CURSOR_PAGINATION_MULTIPLE_SORTING.get() + " to true"); + } CursoredPage cursoredPage = this.manager().selectCursor(query, pageRequest); List entities = cursoredPage.stream().map(c -> converter().toEntity(c)).toList(); PageRequest nextPageRequest = cursoredPage.hasNext()? cursoredPage.nextPageRequest() : null; From 218e30b12f961699527266deb5f97f25548a61cd Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Thu, 12 Sep 2024 20:02:07 +0100 Subject: [PATCH 08/12] docs: fix documentation at Semistructure template Signed-off-by: Otavio Santana --- .../jnosql/mapping/semistructured/SemiStructuredTemplate.java | 1 - 1 file changed, 1 deletion(-) diff --git a/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/SemiStructuredTemplate.java b/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/SemiStructuredTemplate.java index 1b54f4667..8a79019a8 100644 --- a/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/SemiStructuredTemplate.java +++ b/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/SemiStructuredTemplate.java @@ -202,7 +202,6 @@ public interface SemiStructuredTemplate extends Template { */ void deleteAll(Class type); - e /** * Select entities using pagination with cursor-based paging. * From e50cc6708f83dc725a35617971d66424b1d9a1f8 Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Thu, 12 Sep 2024 20:04:41 +0100 Subject: [PATCH 09/12] style: remove unsed imports at semistructure template Signed-off-by: Otavio Santana --- .../mapping/semistructured/AbstractSemiStructuredTemplate.java | 1 - 1 file changed, 1 deletion(-) diff --git a/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java b/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java index 0968aa775..86e3bbfaa 100644 --- a/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java +++ b/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java @@ -22,7 +22,6 @@ import jakarta.data.page.impl.CursoredPageRecord; import jakarta.nosql.QueryMapper; -import org.eclipse.jnosql.communication.Configurations; import org.eclipse.jnosql.communication.semistructured.CommunicationEntity; import org.eclipse.jnosql.communication.semistructured.DatabaseManager; import org.eclipse.jnosql.communication.semistructured.DeleteQuery; From 91299968761f62d7746c0bd26393148846db3fc4 Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Thu, 12 Sep 2024 20:39:23 +0100 Subject: [PATCH 10/12] feat: include validation to semistructure pagaination Signed-off-by: Otavio Santana --- .../AbstractSemiStructuredTemplate.java | 2 +- .../DefaultSemiStructuredTemplateTest.java | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java b/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java index 86e3bbfaa..49b40632a 100644 --- a/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java +++ b/jnosql-mapping/jnosql-mapping-semistructured/src/main/java/org/eclipse/jnosql/mapping/semistructured/AbstractSemiStructuredTemplate.java @@ -333,7 +333,7 @@ public CursoredPage selectCursor(SelectQuery query, PageRequest pageReque Objects.requireNonNull(query, "query is required"); Objects.requireNonNull(pageRequest, "pageRequest is required"); LOGGER.finest(() -> "Executing query: " + query); - var enableMultipleSorting = !MicroProfileSettings.INSTANCE.get(CURSOR_PAGINATION_MULTIPLE_SORTING, Boolean.class) + var enableMultipleSorting = MicroProfileSettings.INSTANCE.get(CURSOR_PAGINATION_MULTIPLE_SORTING, Boolean.class) .orElse(false); LOGGER.finest(() -> "Cursor pagination with multiple sorting is enabled: " + enableMultipleSorting); diff --git a/jnosql-mapping/jnosql-mapping-semistructured/src/test/java/org/eclipse/jnosql/mapping/semistructured/DefaultSemiStructuredTemplateTest.java b/jnosql-mapping/jnosql-mapping-semistructured/src/test/java/org/eclipse/jnosql/mapping/semistructured/DefaultSemiStructuredTemplateTest.java index fc9907d8b..50fb1a3b8 100644 --- a/jnosql-mapping/jnosql-mapping-semistructured/src/test/java/org/eclipse/jnosql/mapping/semistructured/DefaultSemiStructuredTemplateTest.java +++ b/jnosql-mapping/jnosql-mapping-semistructured/src/test/java/org/eclipse/jnosql/mapping/semistructured/DefaultSemiStructuredTemplateTest.java @@ -21,6 +21,7 @@ import jakarta.data.page.impl.CursoredPageRecord; import jakarta.enterprise.inject.Instance; import jakarta.inject.Inject; +import org.eclipse.jnosql.communication.Configurations; import org.eclipse.jnosql.mapping.PreparedStatement; import org.assertj.core.api.SoftAssertions; import org.eclipse.jnosql.communication.semistructured.CommunicationEntity; @@ -517,6 +518,41 @@ void shouldSelectCursor() { } + @Test + void shouldThrowExceptionWhenCursorHasMultipleSorts() { + System.setProperty(Configurations.CURSOR_PAGINATION_MULTIPLE_SORTING.get(), "true"); + PageRequest request = PageRequest.ofSize(2); + + PageRequest afterKey = PageRequest.afterCursor(PageRequest.Cursor.forKey("Ada"), 1, 2, false); + SelectQuery query = select().from("Person").orderBy("name").asc().orderBy("age").desc().build(); + + Mockito.when(managerMock.selectCursor(query, request)) + .thenReturn(new CursoredPageRecord<>(content(), + Collections.emptyList(), -1, request, afterKey, null)); + + PageRequest personRequest = PageRequest.ofSize(2); + + CursoredPage result = template.selectCursor(query, personRequest); + org.assertj.core.api.Assertions.assertThat(result).isNotNull(); + System.clearProperty(Configurations.CURSOR_PAGINATION_MULTIPLE_SORTING.get()); + } + + @Test + void shouldExecuteMultipleSortsWhenEnableIt() { + PageRequest request = PageRequest.ofSize(2); + + PageRequest afterKey = PageRequest.afterCursor(PageRequest.Cursor.forKey("Ada"), 1, 2, false); + SelectQuery query = select().from("Person").orderBy("name").asc().orderBy("age").desc().build(); + + Mockito.when(managerMock.selectCursor(query, request)) + .thenReturn(new CursoredPageRecord<>(content(), + Collections.emptyList(), -1, request, afterKey, null)); + + PageRequest personRequest = PageRequest.ofSize(2); + org.assertj.core.api.Assertions.assertThatThrownBy(() -> template.selectCursor(query, personRequest)) + .isInstanceOf(UnsupportedOperationException.class); + } + @Test void shouldSelectOffSet() { PageRequest request = PageRequest.ofPage(2).size(10); From a36a40ff158d8e199957e812a787aaf7e9999e2b Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Thu, 12 Sep 2024 20:42:01 +0100 Subject: [PATCH 11/12] docs: enhance configurations documentation Signed-off-by: Otavio Santana --- .../jnosql/communication/Configurations.java | 49 ++++++++++++++++--- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/Configurations.java b/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/Configurations.java index 7f8e8dbcf..c09db52dc 100644 --- a/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/Configurations.java +++ b/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/Configurations.java @@ -19,30 +19,63 @@ import java.util.function.Supplier; /** - * This enum contains all the commons configurations that might be used to the NoSQL databases. - * It implements {@link Supplier} which returns the property value on the arrangement. + * This enum contains common configurations that are frequently used for NoSQL databases. + * It provides a standardized way to retrieve configuration keys using the {@link Supplier} interface, + * which allows these properties to be fetched dynamically in different contexts. + * + *

Each constant in this enum represents a specific configuration option, such as connection details + * (user, password, host) or other database-related settings (like encryption and pagination behavior). + * By implementing {@link Supplier}, each enum constant can supply the associated property value directly + * via the {@link #get()} method.

+ * + *

Developers can reference these constants throughout the application to avoid hardcoding configuration + * keys and ensure consistent access to NoSQL database properties. This is particularly useful for managing + * complex or large-scale database configurations where multiple properties (e.g., hosts, pagination settings) + * are involved.

*/ public enum Configurations implements Supplier { + /** - * to set a user in a NoSQL database + * Configuration for setting the user in a NoSQL database. + *

This property is used to specify the username required for authenticating + * the connection to the NoSQL database.

+ *

Example: jakarta.nosql.user=admin

*/ USER("jakarta.nosql.user"), + /** - * to set a password in a database + * Configuration for setting the password in a NoSQL database. + *

This property is used in conjunction with the {@link #USER} configuration + * to authenticate the database connection by providing the user’s password.

+ *

Example: jakarta.nosql.password=secret

*/ PASSWORD("jakarta.nosql.password"), + /** - * the host configuration that might have more than one with a number as a suffix, - * such as jakarta.nosql.host-1=localhost, jakarta.nosql.host-2=host2 + * Host configuration for connecting to the NoSQL database. + *

This property allows setting multiple hosts by using a numbered suffix (e.g., host-1, host-2). + * This is useful for distributed databases or in cases where multiple instances or replicas + * of the database are running.

+ *

Example: jakarta.nosql.host-1=localhost, jakarta.nosql.host-2=remote-host

*/ HOST("jakarta.nosql.host"), + /** - * A configuration to set the encryption to settings property. + * Configuration to enable encryption settings for NoSQL database connections. + *

This property is used to configure encryption settings, which are critical + * for securing data in transit or at rest within the NoSQL database. It defines the encryption + * protocols or keys that should be applied.

+ *

Example: jakarta.nosql.settings.encryption=AES256

*/ ENCRYPTION("jakarta.nosql.settings.encryption"), /** - * A configuration to enable cursor pagination in a NoSQL database using multiple sorting. + * Configuration to enable cursor-based pagination with multiple sorting in NoSQL databases. + *

This property allows enabling cursor pagination with support for multiple sorting fields. + * By default, multiple sorting is disabled due to potential inconsistencies in NoSQL databases when + * sorting by multiple fields that contain duplicate values. Enabling this option allows users to + * explicitly manage multi-field sorting during cursor-based pagination.

+ *

To enable, set: org.eclipse.jnosql.pagination.cursor=true

*/ CURSOR_PAGINATION_MULTIPLE_SORTING("org.eclipse.jnosql.pagination.cursor"); From d23886b82522d12040b93badec72065c2e9cc292 Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Thu, 12 Sep 2024 20:43:29 +0100 Subject: [PATCH 12/12] docs: enhance documentation at readme Signed-off-by: Otavio Santana --- README.adoc | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.adoc b/README.adoc index 72465bd51..4bd206f98 100644 --- a/README.adoc +++ b/README.adoc @@ -266,8 +266,6 @@ private Queue orders; private Map map; ---- - - === Column Family Jakarta NoSQL provides a Column Family template to explore the specific behavior of this NoSQL type.