ydb-platform / yoj-project

YDB ORM for Java (YOJ) is a lightweight ORM for immutable entities. It has native support for YDB and is battle-tested.
Apache License 2.0
13 stars 12 forks source link

Convenient way to create custom query #43

Open lavrukov opened 8 months ago

lavrukov commented 8 months ago

Nowadays, creating custom queries in YOJ is very difficult, which restrict users and forces them to dodge. We need to provide a convenient way.

What's difficult now:

What we want:

Proposal:

lavrukov commented 8 months ago

With this we should think about how to pass parametrs to query without batabind-magic. For example, we can do something like this QueryParametr.builder(MyEntity.class).field("myFieldTimestamp").value(Instant.now()) and use it to convert value to ydb view with all databind rules

Updated: looks like we need think about using classes from https://github.com/ydb-platform/yoj-project/issues/52 for this case