--
You received this message because you are subscribed to a topic in the Google Groups "SimpleFlatMapper" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simpleflatmapper/xZI6Bl8RN-c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simpleflatmapp...@googlegroups.com.
To post to this group, send email to simplefl...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/simpleflatmapper/55f6f2ed-aaa4-4869-be46-15f627007b6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
| public class JsonConverterFactoryProducer extends AbstractConverterFactoryProducer { |
|
|
| @Override |
| public void produce(Consumer<? super ConverterFactory<?, ?>> consumer) { |
| constantConverter(consumer, String.class, JsonNode.class, new StringToJsonConverter()); |
| constantConverter(consumer, Node.class, String.class, new JsonToStringConverter()); |
| } |
Hi
I’m AEST 🙃 so conversation will be slow
I can probably manage to create the conversions I need but just found the documentation on converters a little had to build upon.
If you can give any pointer or further examples that would be great.
I’m thinking either transforming to JsonNode or my own POJO
thanks for the replies
On Tue, 21 Nov 2017 at 4:51 pm, Arnaud Roger <arnaud...@gmail.com> wrote:
The Postgres jdbc driver does not have a json type for json column,
most of the example I see treat the json as s String.
What type would you like to transform into ?a Jackson JsonNode? gson? or any other library?
That should be possible by changing the type in your object and adding a converter - not very complicated but not trivial.
I might add some sample code to do that with jackson.--
On Tuesday, 21 November 2017 01:34:15 UTC, jo...@zynde.com wrote:Hi all,Can anyone give me pointers on the following.I am using PostgreSQL and I have some JSON and JSONB columns being returned to a Spring JDBC implementation.Everything is working fine and I have managed to get SFM in as the RowMapper without any issue so far.I am currently putting a JSON column in to a string field in my Model which is working so I know all the data is moving through correctly. What I would like to do now is convert the JSON in the RowMapping to an Object from the JSON. I'm confused about how to go about creating a converter both back and forwards to the database.Thanks
You received this message because you are subscribed to a topic in the Google Groups "SimpleFlatMapper" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simpleflatmapper/xZI6Bl8RN-c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simpleflatmapper+unsubscribe@googlegroups.com.
To post to this group, send email to simpleflatmapper@googlegroups.com.