Skip to content

Add Fluent Update API to Jakarta NoSQL Specification #203

@otaviojava

Description

@otaviojava

Currently, Jakarta NoSQL supports basic update operations via the Template interface. However, there is no fluent API available for building and executing update queries in a structured and readable way.

This proposal introduces a new fluent Update API that enables developers to construct update queries declaratively, similar to how select operations are handled.

💡 Motivation

A fluent update API aligns with the goal of Jakarta NoSQL to provide a type-safe, readable, and composable way of interacting with NoSQL databases.

It simplifies scenarios where developers need to:

  • Update specific fields of one or more entities
  • Apply conditions to match which entities to update
  • Avoid loading entities in memory just to update them

✅ Example Usage

@Inject
Template template;

template.update(Word.class)
        .set("meaning", "coffee")
        .where("term")
        .eq("java")
        .execute();

The resulting query would match all Word entities with term = "java" and update the meaning field.

📌 Tasks

  • Define fluent API interfaces for update queries
  • Add Template.update(Class<T>) method
  • Update the specification text and documentation
  • Add representative examples in the spec
  • Create corresponding TCK tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions