eventsourcing/es4j

Problem: Min/Max queries are global to the attribute

Open

#209 创建于 2017年1月27日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)Java (27 fork)batch import
enhancementhelp wanted

仓库指标

Star
 (406 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

At this moment, Min/Max queries are limited to finding the smallest or largest value of a particular attribute globally across an entity. Which means you can tell "what's the latest order" but not "what's the latest order for this person". IsLatestEntity/LatestAssociatedEntryQuery are currently being used to address this type of need, but they are very slow and cumbersome. Min/Max has been already optimized for PostgreSQL storage.

It would have been great if it was possible to fit this type query within Min/Max as an option:

// Find the last order for user with id=<id>
max(Order.TIMESTAMP, equal(Order.USER_ID, id))
// Find all last orders for all users
max(Order.TIMESTAMP, Order.USER_ID)

(Or something similar)

贡献者指南