简体   繁体   中英

Using HSQL MEMORY TABLE with grails

是否可以在grails中定义某种映射,以便针对特定grails域将CREATE TABLE替换为CREATE MEMORY TABLE

If you wanted to do this for all tables, you could create a custom Dialect and override getCreateTableString() but there's no way to know the current table name, so it can be selectively applied.

But you can take the approach I suggested here: grails limited table creation . You would just override generateSchemaCreationScript() and if you find the table(s) you're looking for, you can replace the 'create table' string with 'create memory table'.

The create table statements are generated by Hibernate's hbm2ddl feature. I don't think there is a way to configure the syntax of the create statement other than the table name itself and the columns.

You would have to manually manage the schema creation using a plugin like Autobase or Liquibase (or whatever they have coming in Grails 1.4 to handle DB migrations).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM