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

#52: Add generator of constants with names of fields #57

Closed lazarev-pv closed 7 months ago

lazarev-pv commented 8 months ago

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

The PR contains implementation of what was suggested in the issue 52. There are some limitations described in FieldGeneratorAnnotationProcessor's java-docs. Right now it supports only Java classes and records. Support of Kt data-classes could be added if we are ok with the current approach

nvamelichev commented 7 months ago

YOJ ignores transient fields and transient Record components. This annotation processor should do so, too.

lavrukov commented 7 months ago

note: I'm agree with @nvamelichev that it could be better with javapoet

lazarev-pv commented 7 months ago

YOJ ignores transient fields and transient Record components. This annotation processor should do so, too.

Fixed for classes, but if I understand correctly records cannot have modifiers. Btw, I think we need to add the support of @Transient annotation instead of the modifier some day

lazarev-pv commented 7 months ago

note: I'm agree with @nvamelichev that it could be better with javapoet

yep. I'll migrate but I propose to do it in another PR