1.1
Jakarta NoSQL 1.1 builds on the stable 1.0 foundation, improving developer productivity, query capabilities, and integration with the Jakarta EE ecosystem. This release evolves the Mapping API while introducing a minimal, optional Communication API.
The Mapping API remains the primary programming model for Jakarta NoSQL applications. Version 1.1 expands its query capabilities through Jakarta Query integration, parameter binding, typed queries, and improvements to entity attribute mapping. These enhancements preserve the familiar Template-based programming model.
The new Communication API provides two foundational abstractions: Key-Value and Record. It offers common low-level persistence operations while preserving the characteristics and capabilities of underlying NoSQL databases. Adoption is optional, and providers may integrate directly with the Mapping API or use native database drivers.
New features, enhancements or additions
- Update the Java baseline to Java 21 and refresh dependencies.
- Jakarta Query integration: support portable query expressions through the Mapping API. (Jakarta Query GitHub)
- Parameterized queries: introduce query creation, named parameter binding, and typed query results using Template.
- Enhanced attribute mapping: support Map<K, V> attributes containing entities or embeddable values, including applicable Java record models.
- Communication API: introduce optional Key-Value and Record communication models for integrating NoSQL providers.
Jakarta Query and Parameterized Queries
Jakarta NoSQL 1.1 expands the Mapping API with support for Jakarta Query, letting developers express queries through a common query language while preserving each NoSQL database's capabilities and limitations.
The Template API introduces query(String) and typedQuery(String, Class<T>), allowing developers to create queries, bind named parameters, and retrieve mapped Java entities or projection results.
Parameter binding separates query expressions from runtime values, allowing providers to translate and validate queries appropriately.
Query query = template.query(
"FROM Developer WHERE language = :language"
);
List<Developer> developers = query
.bind("language", "Java")
.result();
Typed queries provide an additional level of convenience by specifying the expected result type.
List<Developer> developers = template
.typedQuery(
"WHERE language = :language",
Developer.class
)
.bind("language", "Java")
.result();
Supported query operations depend on the underlying database model and provider. This integration does not require every NoSQL database to implement identical query capabilities.
Enhanced Map Attribute Support
Jakarta NoSQL 1.1 plans to enhance entity mapping by supporting Map attributes whose values are entity or embeddable types. These values can be represented by regular Java classes or supported Java record models.
This enables more expressive data structures, particularly for databases supporting dynamic attributes, nested values, and document-oriented representations.
@Entity
public class Developer {
@Id
private String id;
@Column
private String name;
@Column
private Map<String, Skill> skills;
}
@Embeddable
public class Skill {
@Column
private String name;
@Column
private int experienceInYears;
}
Attribute mapping continues to follow provider capabilities. The specification does not require all NoSQL databases to support the same nested data representations.
Communication API
Jakarta NoSQL 1.1 introduces an optional, low-level Communication API intended to provide a minimal foundation for NoSQL provider integration.
Unlike the Mapping API, which focuses on Java entities, object mapping, and developer productivity, the Communication API focuses on fundamental database operations.
The API defines two foundational communication models:
- Key-Value API: key-based storage, retrieval, updates, and deletion.
- Record API: common record persistence operations for document, column, graph, time-series, and vector databases.
The Communication API is intentionally minimal. It does not standardize native query languages, graph traversal, vector similarity search, time-series aggregation, or other specialized database capabilities.
Providers can use native drivers and expose additional functionality through their implementations. Implementing the Jakarta NoSQL Mapping API does not require using the Communication API.
Key-Value Communication API
The Key-Value API models data as an association between a key and a value. It provides fundamental persistence operations while allowing the database to determine consistency, durability, replication, and other implementation-specific characteristics.
The API includes KeyValueRecord, KeyValueManager, and KeyValueManagerFactory.
KeyValueManagerFactory factory = ...;
KeyValueManager manager = factory.get("users");
KeyValueRecord record = ...;
// Store a record
manager.put(record);
// Retrieve by key
Optional<KeyValueRecord> result =
manager.findByKey("user:1");
// Delete by key
manager.deleteByKey("user:1");
Additional operations, including time-to-live policies, may be available according to provider and database capabilities.
Record Communication API
The Record API provides a database-neutral abstraction for common record persistence operations. It is designed as a foundation for document, column, graph, time-series, and vector databases without imposing a universal data representation.
The API includes Record, RecordManager, and RecordManagerFactory. Providers define their own record representations and adapt the common operations to their underlying databases.
RecordManagerFactory factory = ...;
RecordManager<MyRecord> manager =
factory.get("users");
MyRecord record = ...;
// Insert
MyRecord inserted = manager.insert(record);
// Update
MyRecord updated = manager.update(inserted);
// Find by key
Optional<MyRecord> result =
manager.findByKey("user:1");
// Delete by key
manager.deleteByKey("user:1");
The Record API deliberately avoids specifying advanced querying or database-specific operations. Future releases may introduce specialized abstractions where implementation experience demonstrates a clear benefit.
Removals, deprecations or backwards incompatible changes
- The experimental Communication API has been simplified into Key-Value and Record models, replacing the previous specialized document, column, and graph communication contracts.
- Java 21 is the target baseline for version 1.1.
- The Mapping API retains its existing Template-based programming model.