Hibernate with JSON (no DB table)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Hibernate with JSON (no DB table)



I am stuck with a peculiar scenario on JSON / Hibernate. Here goes -



I have an existing application with Oracle DB and Hibernate / JPA. Now, I need to use JSON data rather than DB table data for some of the domain / entity classes while keeping the hibernate framework intact. This is required because I still need to use the existing hibernate / Oracle interaction for the rest of the domain classes. Once I replace the DB table data with JSON, those DB tables will no longer be available to the application. How can I achieve this?



Thank you in advance.



EDIT:
Thanks Vlad for you input. I went through the article. But I think my scenario is a little different. Let's say I have two entities - Country and City which are currently mapped to the DB tables COUNTRY and CITY respectively. City has a Country. Now, I want to remove the DB table COUNTRY and instead provide JSON data to the application. How can I handle that while still enjoying Hibernate services like caching etc even for Country.




1 Answer
1



Use the hibernate-types project which allows you to persist JSON properties as:



For an example, check out this article.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard