-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Saving persisted objects to file
PostPosted: Mon Jun 27, 2016 5:40 pm 
Newbie

Joined: Mon Aug 31, 2015 3:15 am
Posts: 3
Maybe I am searching for the wrong keywords but I could not find any information on whether it is possible to save persisted objects to files...

I have a business application that is locally installed and uses hibernate to save its actual state. It would be nice not only to store the persisted obects in a database but also save them to a local file. Doing so would make the update process of the application safer (as the database can be completely replaced) and offer the possibility to share data between users on the network (a dedicated database server is no option for security reasons).
I think it should be possible to save the state of the database with simple Insert-Statements in a text-file, but can find no reference to a working solution (or even the thought to do so).

Do i have any misconception in my thinking? Any thought on this or hint to lead me to a new understanding is highly appreciated.


Top
 Profile  
 
 Post subject: Re: Saving persisted objects to file
PostPosted: Tue Jun 28, 2016 4:52 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1630
Location: Romania
Hibernate is an Object/Relation Mapper, so your entities will be mapped to database tables. There is no need to store entities to files when you can use a lightweight database like HSQLDB which has disk persistence as well. All in all, your entities are basically stored in some files on disk, just that in a compacted binary form.

Because of the ACID guarantees, SQL capabilities, Indexing options, and in-memory buffer optimizations, a database is way more suitable than a plain text file even for trivial tasks.

You can also use JSON, and, this way, your Domain Model is not strictly tied to a fixed schema.


Top
 Profile  
 
 Post subject: Re: Saving persisted objects to file
PostPosted: Tue Jun 28, 2016 4:02 pm 
Newbie

Joined: Mon Aug 31, 2015 3:15 am
Posts: 3
Thank you for your answer, I will definitely have a look at JSON and the link you provided. It seems to be what I want, a way to interchange persisted data from one local application that uses hibernate to another.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.