The 1.2 release builds on the foundation established in 1.1, focusing on improving expressiveness and usability across both the Communication and Mapping APIs. It introduces enhancements that enable more practical data access patterns while preserving the flexibility and extensibility defined in the previous version.
On the Mapping API, this release evolves the programming model toward a more declarative and expressive approach. By expanding support for Jakarta Query and introducing function-based operations, developers can describe data access more concisely and flexibly, improving readability while maintaining compatibility with existing applications.
On the Communication API, this release introduces an operational query model based on explicit operation types and reusable conditions. This approach enhances data interaction capabilities while preserving the API's imperative nature and maintaining its role as a lightweight, extensible integration layer.
Mapping API
On the Mapping API, this release expands support for Jakarta Query and introduces function-based operations. These enhancements enable a more declarative and expressive approach to data access, allowing developers to describe queries using composable expressions and transformations. By leveraging Jakarta Query, the Mapping API provides a consistent and flexible way to define data retrieval logic while maintaining compatibility with existing applications and programming models.
var words = template.select(Word.class) .where(Function.upper("meaning")) .eq("COFFEE") .result();
var products = template.select(Product.class) .where(Function.abs("price")) .gt(10) .result();
Communication API
On the Communication API, this release introduces a query model based on operation-specific structures, such as selection, update, and deletion, combined with a shared condition model for filtering. This approach allows each operation to define its own structure and behavior while enabling the reuse of conditions across queries. It preserves the imperative nature of the API and avoids reliance on query languages or declarative DSLs, allowing implementations to map these operations to their native capabilities while maintaining flexibility and extensibility.
RecordManager records = provider.getRecordManager("users");
// Shared condition
Condition condition = Condition.and(
Condition.eq("name", "Otavio"),
Condition.gt("age", 18)
);
// Select
SelectQuery select = SelectQuery.from("users")
.where(condition);
Iterable<Record> result = records.select(select);
// Update
UpdateQuery update = UpdateQuery.from("users")
.where(condition)
.set("status", "active");
records.update(update);
// Delete
DeleteQuery delete = DeleteQuery.from("users")
.where(condition);
records.delete(delete);