Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta-Annotations for @Column and @CustomValueType #50

Merged
merged 5 commits into from
Mar 14, 2024

Conversation

g-sg-v
Copy link
Contributor

@g-sg-v g-sg-v commented Mar 14, 2024

Review comments fixed:

  • simple test;
  • Annotations.java moved to util module;
  • comment about search added.

- simple test;
- Annotations.java moved to util module;
- comment about search added.
@nvamelichev
Copy link
Collaborator

Let's add a @StringColumn meta-annotation that is equivalent to

@Column(customValueType=@CustomValueType(
    columnValueType=FieldValueType.STRING,
    columnClass=String.class,
    converter=StringValueConverter.class
)

?

This will allow fun like @StringColumn UUID uuid fields in entity classes :-)

@nvamelichev
Copy link
Collaborator

nvamelichev commented Mar 14, 2024

Maybe also make @CustomValueType usable in a meta-annotation?
E.g.: you will be able to add @StringValueType annotation for on class, and that will be <=> @CustomValueType(..., converter=StringValueConverter.class)

You would only need to touch CustomValueTypes.getCustomValueType() method to do that, I think:

-        var cvt = columnCvt == null ? rawType.getAnnotation(CustomValueType.class) : columnCvt;
+        var cvt = columnCvt == null ? Annotations.find(CustomValueType.class, type) : columnCvt;

@nvamelichev nvamelichev changed the title Annotations "inheritance" Meta-Annotations for @Column and @CustomValueType Mar 14, 2024
@nvamelichev nvamelichev merged commit dd9252f into ydb-platform:main Mar 14, 2024
1 check passed
@g-sg-v g-sg-v deleted the aliases-annotations branch March 15, 2024 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants