Jakarta NoSQL 1.1

The 1.1 release builds directly on the stable 1.0 foundation. It enhances interoperability, boosts developer productivity, and aligns more closely with the Jakarta EE ecosystem.

This release introduces the Communication API as an optional, lower-level abstraction for direct NoSQL database interaction. It defines a common model for vendor integration. At the same time, it preserves native behavior and characteristics. The API serves as an integration layer. Implementations can connect their official APIs to Jakarta NoSQL without altering underlying behavior. It emphasizes extensibility and provides a minimal, flexible foundation for NoSQL data access.

For the Mapping API, this release adds support for Jakarta Query, prepared statement execution, and better attribute mapping. These changes simplify data access and make it more expressive. The existing programming model stays the same.

 

New features, enhancements or additions

  • Update dependencies
  • Update Java version
  • Jakarta Query supports for fluent, portable query definitions (Jakarta Query GitHub)
  • Prepared Statement support for parameterized and secure query execution.
  • Support for Map<K, V> attributes where V is an entity or embedded class.
  • Add support for SequencedCollection and friends
  • Communication API to unify and simplify the integration of NoSQL providers

 

Map support with embedded values

This release introduces support for Map attributes in entity models where the map values are either entity classes or embeddable classes. These types can be defined using regular classes or Java records and must be annotated with @jakarta.nosql.Entity or @jakarta.nosql.Embeddable, respectively.

This enhancement enables modeling more expressive, structured data in which a key is associated with a dynamic or nested value, which is useful in many NoSQL databases that support this behavior, including several document-based databases.

 

@Entity
public class Developer {

  @Id
  private String id;

  private String name;

  @Column
  private Map<String, Skill> skills;
}

@Embeddable
public class Skill {

  private String name;

  private int experienceInYears;
}

 

Support for Jakarta Query and Prepared Statements

Jakarta NoSQL 1.1 introduces support for Jakarta Query, a fluent, portable query language that enables developers to express queries consistently across both NoSQL and relational systems. In addition, this version supports prepared statements, which safely bind parameters and facilitate the execution of reusable queries. This feature enhances both query performance and security, particularly in dynamic query scenarios.


Query query = database.prepare( "FROM Developer WHERE language = :language");
prepared.bind("language", "Java");
var developers = prepared.result();

 

Communication API to unify and simplify the integration of NoSQL providers

The Communication API offers an optional, simpler way to work directly with NoSQL databases, adding to the Mapping API without replacing it. This layer sets a common way to interact with data access operations without forcing the same rules on all NoSQL systems. It allows Jakarta NoSQL to work with vendor-specific versions, presenting native database features in a consistent, easy-to-use way while preserving their unique traits, such as how they handle consistency and data storage. The API is built to be flexible, letting implementations grow and add new features without being limited to a fixed set of actions. Vendors can create integration parts that link their versions to the Communication API, following the rules but staying flexible. Using the Communication API is optional; implementations can connect directly to the Mapping API without it, ensuring it fits different needs and does not disrupt existing setups.

 

Keyvalue

 

The key-value model provides a simple interaction pattern in which data is accessed via a unique key that maps to a value. The Communication API defines a minimal set of operations for storing, retrieving, and removing data, allowing implementations to map these interactions to their native capabilities without imposing assumptions about structure or behavior.

 

BucketManager bucket = provider.getBucketManager("users");

// Store values
bucket.put("user:1", "Otavio");
bucket.put(Entry.of("user:2", "Ada"));

// Retrieve a value
Optional<Value> result = bucket.get("user:1");
result.ifPresent(v -> System.out.println(v.get(String.class)));

// Retrieve multiple values
Iterable<Value> values = bucket.get(List.of("user:1", "user:2"));

// Delete
bucket.delete("user:1");

 

Semistructured

The semistructured model enables interaction with data that has flexible, nested structures, such as collections of attributes and hierarchical values. The Communication API provides a minimal set of operations to store, update, and remove these structures, allowing implementations to map them to their native capabilities without enforcing a fixed schema or uniform behavior.

 

RecordManager records = provider.getRecordManager("users");

// Create a record
Record record = Record.of("users");
record.add("id", 1);
record.add("name", "Otavio");

// Insert
records.insert(record);

// Update
record.add("name", "Ada");
records.update(record);

// Delete
records.delete(record);
 

 

Removals, deprecations or backwards incompatible changes

  • none

     
Release Date
Release Type
Minor release