-
Notifications
You must be signed in to change notification settings - Fork 293
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
Attribute converter like functionality for spring-cloud-gcp-data-datastore #438
Comments
You're right about only global converters being currently supported as described here. If that doesn't work for you, something like JPA's |
Right now, there's no infrastructure for property-specific converters. Neo4j and Elasticsearch went forward to introduce their store-specific mechanisms. We have a ticket in Spring Data Commons (spring-projects/spring-data-commons#1484) to design and come up with some infrastructure. |
Well this tells me the "issue" is real, but just not painful enough for anybody, so everybody is doing a workaround instead. The issue was opened 4 years ago, and barely any interaction on it. Anyway I always thought it's strange it was missing from spring-data and this was usually the reason we went with JPA instead - when we could. My guess is JPA was a too easy and quick alternative for others as well. Not an option with datastore. Unfortunately my knowledge is far from deep enough to contribute code to such a huge feature - even so that I guess there is a reason Neo4j and Elasticsearch did the specific version as well, and not the general one. So what is the expected flow here? Let the issue be dependent on that one, or should it be closed? |
We don't have a final design for the API and since we expect some changes in the actual store module I'd suggest keeping this ticket open. |
update: Spring Data Common has added "support for property-specific converters" in 3.0.0-M2 |
Bumps [reactor-bom](https://github.com/reactor/reactor) from 2020.0.10 to 2020.0.11. - [Release notes](https://github.com/reactor/reactor/releases) - [Commits](reactor/reactor@2020.0.10...2020.0.11) --- updated-dependencies: - dependency-name: io.projectreactor:reactor-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Is your feature request related to a problem? Please describe.
I'm unable to do custom conversions of specific fields between the pojo and db state, because this widely available feature is missing from spring-cloud-gcp-data-datastore, 2.0.2
Describe the solution you'd like
https://www.baeldung.com/jpa-attribute-converters#using-the-converter for spring-cloud-gcp-data-datastore :)
Describe alternatives you've considered
Without spring data support, I'm forced to use https://github.com/objectify/objectify/blob/master/src/main/java/com/googlecode/objectify/annotation/Translate.java.
Additional context
The goal isn't to have a global converter that converts between type A and type B (I think that is already available), but to have an annotation that can control this at the field level OR a global converter that receives the
Field
object it's converting - so for example it can check for any kind of custom annotation being present. (For example creating a@Sensitive
annotation that triggers an encryption during the conversion. https://aws.amazon.com/blogs/developer/client-side-encryption-for-amazon-dynamodb/ does something like this with@DoNotEncrypt
).The text was updated successfully, but these errors were encountered: