Comments (3)
This one is interesting, cloning the ObjectMapper will make IdView support in DTOs disappear again.
The point is, if BPs deserializer is not added on the OM of spring boot, spring boot will not be abler to deserialize things like
public class SomeDTO {
public UserIdView user;
}
The be frank:
- using a clone of OM, will make the deserialization of
SomeDTO
not work - NOT using a clone will make the deserialization
SomeDTO
, but will break some serialization
from blaze-persistence.
After reading up what INFER_PROPERTY_MUTATORS
actually does, it seems like disabling it is actually rather a good practice after all.
To fix the issue for us, we had to add setters to our ProblemResponse
.
I'am not sure where it leaves us, since there are arguments in both directions
- clone within BP so no surprising changes like the above happen to the OM for any other deserialization (side effect)
- ensuring the educate the user of the integration about this side effect, and let the user decide to clone or not
Wit 1.
BP loses the support to deserialize any IdViews in DTOs (while it would have the support), with 2.
, if uncloned, the support for the former still works.
So it is kind of surprising on each strategy, but since doing 1.
cannot be reverted and thus the user cannot opt in for deserialization support, but .2
lets the user decide himself to clone (lose it, less side effects), or not (deserialization support).
So considering there is no right or wrong in having less side effects or support for des., i would tend to go with 2.
, so depending on external clone if needed. It is flexible and can cover all cases - and it is what is implemented now.
The only thing that needs consideration is, documentation and education about the side effect
from blaze-persistence.
Thank you for the discussion and clarification @beikov - we know understand that what happened here was actually 'using a side-effect' of a non-clone OM which we ourself used to create a custom EntityViewAwareMappingJackson2HttpMessageConverter
( see #1899). So BP already clones the OM just fine for the MVC integration.
In addition, the support for deserializing EVs in DTOs was yet never intended, thus #1898 tries to discuss it's implementation.
Closing this issue as invalid / miss understanding. Thank you @beikov for your patience :)
from blaze-persistence.
Related Issues (20)
- Allow multiple named subqueries for @MappingSubquery
- Optimization of logging in the AnnotationUtils Utility Class HOT 1
- FR: Support field-EntityView deserializatin for DTOs which are non-entity views
- Expose EntityViewAwareMappingJackson2HttpMessageConverter as a Bean to support re-usage for http-clients
- Property naming strategy for Jackson integration does not work HOT 3
- How to ignore a certain `Getter` in EntityView? HOT 1
- Query DSL with blaze-persistence is generating an extra joining HOT 6
- SubviewAttributeFlusher always cascade deletes
- Exception thrown when using LocalDate in an EntityView being fetched using the Multiset strategy
- Startup error with Spring Boot 3.3.0 and Blaze Persistence Repositories HOT 5
- "No viable alternative at input" error near 'entity_function'
- Exception thrown when using subQuery + pagedList
- Fetching of MULTISET attribute not working HOT 3
- Question. Can i use fields mapped as @Convert in multiset mode? HOT 1
- Cannot invoke "EntityType.getName()" because the return value of "JoinNode.getTreatType()" is null HOT 1
- Pagination in queries that join on an @OneToMany or @ManyToMany attribute return duplicate results HOT 1
- IS NOT NULL not possible in correlationExpression HOT 3
- Exclude Certain Attributes in View HOT 2
- Simple query with an EXISTS clause and pagination adds an unnecessary inner ID query HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blaze-persistence.