eventsourcing/es4j

Problem: impossible to define indices in Scala

Open

#174 创建于 2016年10月29日

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

仓库指标

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

描述

According to a report by @bsrk, and subsequent verification, Scala does not support static fields in classes. It does have companion objects, however, since Scala does not consider it a class and it is therefore impossible to specify it in the @Indices(Array(MyEventIndices)) annotation.

Proposed solution: implement a ScalaObjectIndexLoader that will use Scala's own reflection, but other ideas are welcome.

Temporary workaround (for those who need one): write your index definitions in separate Java classes and refer to them in @Indices(...) annotations.

贡献者指南