Skip to main content

2 posts tagged with "expression"

View All Tags

Optional Redis and Property-Level RawSQL

· One min read
TeaQL Code Gen
Core Contributor

Optional Redis significantly lowers deployment barriers. Property-level RawSQL increases query flexibility.

Optional Redis

+ Redis is now an optional dependency
+ LocalLockService: in-memory lock for non-Redis environments
+ RedisLockService: distributed lock when Redis is available
+ TQLAutoConfiguration: conditionally loads based on classpath

Before: spring-boot-starter-data-redis was mandatory.

After: Works without Redis, automatically falling back to local locks.

Property-Level RawSQL

@RawSQL("CONCAT(first_name, ' ', last_name)")
String getFullName();

Three levels fully supported: Property-level, Criteria-level, Select-level.

Aggregation Function Prefixes

+ Configurable prefix for aggregation result columns
+ Prevents column name conflicts in multi-aggregation queries

Request Pagination

Generated Request classes automatically include page and pageSize fields.

Expression orElse/orElseThrow

String name = Q.user().name().orElse("Unknown");
String email = Q.user().email()
.orElseThrow(() -> new BusinessException("Email required"));

Aligns with Java Optional conventions.

Dynamic Search and Expression System

· One min read
TeaQL Code Gen
Core Contributor

Over 60 commits in a single month introduced dynamic search, the expression API, event system, and web framework.

DynamicSearchHelper

Build search queries from external input (JSON, request parameters) without writing Java code:

DynamicSearchHelper.search(ctx, "Order", jsonFilter, pageable);

Ideal for generic admin panels, mobile backends, and API gateways.

ValueExpression API

Reference entity properties in a type-safe way:

Q.orders().filter(
ValueExpression.of(Q.orders().amount()).gt(100)
).executeForList(ctx);

ID Generator System

  • Remote ID Generator: Fetch IDs from a remote service
  • Default ID Generator: Local UUID-based fallback
  • Configurable per-entity ID generation strategy

Property Change Events

PropertyChangeEvent tracks which properties changed during an entity update, enabling selective SQL UPDATE and audit logging.

Web Response Framework

  • WebStyle: UI style definitions
  • WebAction: Frontend action descriptors
  • WebResponse: Standardized response objects

Soft Delete

entity.setDeleted(true);  // soft delete
entity.recover(); // restore