From: David L. (JIRA) <no...@at...> - 2006-05-29 13:34:40
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-668?page=comments#action_23186 ] David Leal commented on HBX-668: -------------------------------- Max, I mean to define table space informaion on the create table for the primary key definition, for example I get the following create sentence using hbm2ddl (for oracle configuration): create table lra.lra_asset_management ( cif varchar2(9) not null, name varchar2(40), short_name varchar2(20), cnmv_code varchar2(6) unique, primary key (cif) ); but I would like to add a particular tablespace for the table and for the primery key, so: create table lra_asset_management ( cif varchar2(9) not null, name varchar2(40), short_name varchar2(20), cnmv_code varchar2(6) ) TABLESPACE BDACCVDO STORAGE ( INITIAL 960 NEXT 32 ); and for primary key: ALTER TABLE lra_asset_management ADD CONSTRAINT PK_LRA_ASSET_MANAGEMENT PRIMARY KEY (cif) USING INDEX TABLESPACE BDACCVIO PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 240 NEXT 8 MINEXTENTS 1 MAXEXTENTS 99 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 ); so I wanto to have the primary key and table definition on a different tablespace. My suggestion, is at least to allow on hbm2dll the user can control if the generated script file will use ALTER TABLE, or just primary key definition on the create table statement. The best solution, would be to allow additional information on the configuration property file in order to specify the tablespace info for tables and primary keys, beside additional information, such as create index definition, for example something like this: lra_asset_management.tablespace = TABLESPACE BDACCVDO STORAGE ( INITIAL 960 NEXT 32 ) and PK_LRA_ASSET_MANAGEMENT.tablespace = USING INDEX TABLESPACE BDACCVIO PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 240 NEXT 8 MINEXTENTS 1 MAXEXTENTS 99 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 so the name of the property will be the name of the table name or primary key name, plus tablespace suffix. Another property would be set too for adding create index information, for example: index = \ CREATE UNIQUE INDEX UQ_1_lra_asset_management \ ON @USER.@lra_asset_management (cnmv_code) \ PCTFREE 10 INITRANS 2 MAXTRANS 255 TABLESPACE @TABLESPACE@ STORAGE ( INITIAL 240 NEXT 8 PCTINCREASE 0 MINEXTENTS 2 MAXEXTENTS 2147483645 ); > Additional configuration for hbm2ddl script generation > ------------------------------------------------------ > > Key: HBX-668 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-668 > Project: Hibernate Tools > Type: Improvement > Versions: 3.1.beta5 > Reporter: David Leal > > > Just to suggest some additional configuraiton for hbm2ddl script generation, for example: > - Adding possibility to configure if the primary key can be defined using alter table instead on the create sentence. > - The same for unique index. > - Adding possibility for configuring information not provided by the *.hbm files, for example tablespace information. For example on the configuration file, could be defined the tablespace information for each table/index, primary key, etc. > The alter table aproach is better for production database in order to add tablespace information, such configuration can't be set on the create table sentence. > Thanks in advance, > David -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |