Comments (3)
This should work. Blaze-Persistence delegates the serialization process to Jackson after it created the object. Can you please share the exception that you're getting and an example?
from blaze-persistence.
The serialization part works, but "de"-serialization does not. I don't get an error, the properties just deserializes to null.
This also goes when adding custom to the object mapper builder. If I do something like this, the serializers works but the overridden function for deserializers is never called.
@Bean
fun jsonCustomizer(): Jackson2ObjectMapperBuilderCustomizer =
Jackson2ObjectMapperBuilderCustomizer { it
.serializers(LifeCycleStatusSerializer())
.deserializers(LifeCycleStatusDeserializer())
.propertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE)
}
internal class LifeCycleStatusSerializer : StdSerializer<LifeCycleStatus>(LifeCycleStatus::class.java) {
override fun serialize(status: LifeCycleStatus, generator: JsonGenerator, provider: SerializerProvider) {
generator.writeNumber(status.value)
}
}
internal class LifeCycleStatusDeserializer : StdDeserializer<LifeCycleStatus>(LifeCycleStatus::class.java) {
override fun deserialize(jsonParser: JsonParser, context: DeserializationContext): LifeCycleStatus {
val node: JsonNode = jsonParser.codec.readTree(jsonParser)
return LifeCycleStatus.valueOf(node["life_cycle_status_id"].asInt())
}
}
from blaze-persistence.
Ok, let me correct this
Blaze-Persistence delegates the serialization and deserialization process to Jackson after it created the object.
Can you maybe provide a reproducer for this in this test class? https://github.com/Blazebit/blaze-persistence/blob/main/integration/jackson/src/test/java/com/blazebit/persistence/integration/jackson/EntityViewAwareObjectMapperTest.java
from blaze-persistence.
Related Issues (20)
- Re-using ObjectMapper from spring-boot for EntityViewAwareMappingJackson2HttpMessageConverter leads to issues HOT 3
- 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
- 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.