initShim breaks Spring Data JDBC
See original GitHub issueSpring folks ignore the transient
keyword by design. As a result Spring tries to persist the field and fails.
I tried (without success) adding @Transient
to it like this
@InjectTransient
@Nullable
protected abstract Object initShim();
@InjectAnnotation(type = Transient.class, target = FIELD)
@Target(METHOD)
@interface InjectTransient {}
Would be nice to have a solution/workaround
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Spring Data JDBC - Reference Documentation
The Spring Data JDBC project applies core Spring concepts to the development of solutions that use JDBC databases aligned with Domain-driven ...
Read more >Spring data jdbc seems not working with final attributes
I'm trying spring data JDBC (1.1.0.M3). I have a Formateur (Teacher) class which contains an email attribute (class Email).
Read more >Spring Data JPA to Spring Data JDBC – a smooth ride?
Spring Data JPA and Spring Data JDBC use Spring Data Commons as a base library. Both share the same abstractions; the most important...
Read more >spring-projects/spring-data - Gitter
Hi Team, I am using spring data ignite library and having configuration done ... the subsequent resized images for UI efficiency with JDBC...
Read more >Is there a reason to not use Spring Data JPA and Jackson in ...
I'm hoping that Spring Data JDBC will get query method derivation ... know to stay away from fringe parts that break between upgrades....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have a similar issue while working with Spring jdbc. Got a working solution relying on
unsafeDefaultAndDerived = true
. @elucash Is that going to be an issue moving forward since it is the older way of doing things?(no luck with
SYNTHETIC_FIELDS
but I may have missed something)by disabling builtin container handling, Immutables doesnt not consider array as an array but as regular reference type (as anything extending Object) and calls
Object.equals
. You’ve probably disabled containers to fight something in a way containers work by default, so some other solution may be needed, dunno if this can be solved byjdkOnly
orbeanFriendlyModifiables
. In general, if not for the peculiarities of serialization mechanisms, I would wrap any raw array into either collection or specialized type (ByteString
/MyBlob
/Data
) just for the purpose of controllingtoString
, equivalence and [de-]serialization (how hard it can be to override some serializers/adapters? well for some technologies this definitely a PITA)