-->
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.  [ 2 posts ] 
Author Message
 Post subject: Export Tablespace and Filespace from Hibernate hbm files
PostPosted: Mon Dec 26, 2005 8:14 am 
Newbie

Joined: Mon Dec 26, 2005 7:58 am
Posts: 9
Hello,
I would like to create a schema from an existing hibernate.cfg.xml file. To do that, I created an ant task (using SchemaExport class) and everything seems to work just fine (drop/create table created successfully). My goal is to associate a given table to a tablespace/filespace I had created manually before for my schema.
I am using DB2 8.2 and the code I used to generate (manually) the filespace looks like the following:

CREATE LARGE TABLESPACE FILE_TABLE_SPACE
PAGESIZE 32 K
MANAGED BY DATABASE
USING ( FILE 'C:\DB2\NODE0000\SQLFILE\FILE_CONTAINER1' 9600,
FILE 'C:\DB2\NODE0000\SQLFILE\FILE_CONTAINER2' 9600,
FILE 'C:\DB2\NODE0000\SQLFILE\FILE_CONTAINER3' 9600 )
EXTENTSIZE 32
OVERHEAD 10.5
PREFETCHSIZE 32
TRANSFERRATE 0.14
BUFFERPOOL "FILE_POOL";

CREATE REGULAR TABLESPACE FILESPACE IN DATABASE PARTITION GROUP IBMDEFAULTGROUP PAGESIZE 4096 MANAGED BY DATABASE
USING (FILE 'C:\DB2\NODE0000\SQLFILE\FILE_REG_CONTAINER1'5120,
FILE 'C:\DB2\NODE0000\SQLFILE\FILE_REG_CONTAINER2'5120,
FILE 'C:\DB2\NODE0000\SQLFILE\FILE_REG_CONTAINER3'5120)
EXTENTSIZE 16
PREFETCHSIZE 16
BUFFERPOOL IBMDEFAULTBP
OVERHEAD 10.500000
TRANSFERRATE 0.140000;


Before using hbm2ddl technique, I used to create the table manually and the table creation schema code that associates to the above filespace looks like the following:
CREATE TABLE BINARY_FILE_TBL (
"ID" INTEGER NOT NULL ,
"CONTENT" BLOB(31457280) LOGGED NOT COMPACT,
"NAME" VARCHAR(256) ,
"FILE_SIZE" BIGINT )
IN "USERSPACE1";
IN "FILESPACE"
LONG IN "FILE_TABLE_SPACE"
;

My goal is to imitate the code in the bold text (“in userspace1; in filespace long in…”) with my hbm file.
Although running separately the above sql code (CREATE REGULAR TABLESPACE…) is reasonable but concatenating manually the “in userspace1; in filespace long in…” (And also the LOGGED NOT COMPACT of content property) every time I export the schema is unacceptable.
Is there a way I can add those fragments to the ExportSchema file result via my hbm.xml file ?????

I am using Hibernate 3.0.5, using RAD as my IDE.

Thanks a lot.


Hibernate version: 3.0.5
Name and version of the database you are using: DB2 8.2


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 26, 2005 8:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no it is not possible per se.

look in jira, have been reported before. patches welcome.

_________________
Max
Don't forget to rate


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