Re: ORM alternative features in HSQLDB version 2.3.4
Fred Toussi <[email protected]> Fri, 25 Mar 2016 14:43:57 +0000
| Newsgroups | gmane.comp.java.hsqldb.user |
|---|---|
| Message-ID | <[email protected]> |
There is some information in the Guide, but it's not online yet. The purpose of storing objects in the database without any ORM is to reduce the amount of coding and database modifications when you add fields to the Java classes. Your JSON objects have a lot of fields but for finding them you only need to store the searchable fields separately in database tables and create an index on the columns. For example, your object may have all the information about a movie, but you only search for the title, director or actors. So if you create a relational database with tables for the movie, director and actor names, and add the movie object as a field to the table containing title, you can retrieve the movie object after a search and access all the rest of the information. Some information below: >From version 2.3.4 there are two options for storing Java Objects. The default option allows storing Serializable object. The objects remain serialized inside the database until they are retrieved. The application program that retrieves the object must include in its classpath the Java Class for the object, otherwise it cannot retrieve the object. Any serializable Java Object can be inserted directly into a column of type OTHER using any variation of PreparedStatement.setObject() methods. The alternative Live Object option is for mem: databases only and is enabled when the database property sql.live_object=true is appended to the connection property that creates the mem database. For example 'jdbc:hsqldb:mem:mydb;sql.live_object=true' With this option, any Java object can be stored as it is not serialized. The SQL statement SET DATABASE SQL LIVE OBJECT TRUE can be also used. On Thu, Mar 24, 2016, at 23:56, Gnani Swami wrote: > Hi Fred, > > "-- added support for storing live Java Objects in mem: databases > with live_object connection property" - Seems quite interesting, But > I couldn't find any documentation about it. Can I use HSQLDB without > any ORM? Is there a way I could store JSON object and fire SQL > against it. > Cheers > > On Mon, Mar 21, 2016 at 9:21 PM, Fred Toussi > <[email protected]> wrote: >> The latest Release Candidate 2 jar (corresponding to SVN /trunk >> revision 5570) is available now from the hsqldb.org web site: >> >> http://www.hsqldb.org/download/ >> >> See the changelist: >> >> http://hsqldb.org/doc/2.0/changelist_2_0.txt >> >> Important new capabilities such as UUID type and SYNONYM have been >> added. >> >> The final release will be out soon. Please test the Release >> Candidate 2 jar with your applications and report any issues as soon >> as possible. >> >> Fred Toussi HSQLDB Project ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140 _______________________________________________ Hsqldb-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/hsqldb-user