-->
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.  [ 6 posts ] 
Author Message
 Post subject: Creating cached table on HSQL w/ hibernate
PostPosted: Sat Dec 18, 2004 12:30 am 
Newbie

Joined: Thu Dec 16, 2004 6:47 am
Posts: 2
Hi

I wonder how to create a cached table w/ hibernate

Hibernate usually generates the following for table creation:
CREATE TABLE EVENTS(UID BIGINT NOT NULL PRIMARY KEY,DATE TIMESTAMP,EVENTTITLE VARCHAR(255))

but then the syntax for creating cached table on HSQL should've been:
CREATE CACHED TABLE EVENTS(UID BIGINT NOT NULL PRIMARY KEY,DATE TIMESTAMP,EVENTTITLE VARCHAR(255))

The problem I have:
As you can see, there is only one difference: the word "cached." How to get Hibernate generate the table creation with the word "CACHED" in it?

Thanks
Kris


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 31, 2005 9:39 am 
Newbie

Joined: Mon Jan 31, 2005 9:33 am
Posts: 3
Hi,

I have exactly the same problem with Hibernate + HSQLDB. Does anyone have any idea for this?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 31, 2005 10:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
afaik someone have put a CacheHSQLDialect into the jira/wiki.

look for that.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 01, 2005 6:50 am 
Newbie

Joined: Mon Jan 31, 2005 9:33 am
Posts: 3
OK, I've found it, thanks. Don't you plan to integrate it in a future version? I think it would be very useful.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 01, 2005 7:43 am 
Contributor
Contributor

Joined: Thu Nov 06, 2003 9:49 pm
Posts: 104
Location: New York, NY
One trick that I've used with HSQLDB is to edit the .script file after a proper shutdown and insert the CACHED keyword for the tables that I want to be of that type. Since the CREATE TABLE statements are at the top of the script file, this is pretty easy.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 01, 2005 8:28 am 
Newbie

Joined: Mon Jan 31, 2005 9:33 am
Posts: 3
Hi,

Yes, it's also a possible way, but I prefer creating the schema from the Java file:

Configuration cfg = new Configuration()
.addClass(examples.example1.Book.class);
new SchemaExport(cfg).create(true,true);
//new SchemaUpdate(cfg).execute(true, true);

In my case I need to delete all tables first, that's why I do it this way. So this HSQLCachedTableDialect would be very useful.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.