-->
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.  [ 11 posts ] 
Author Message
 Post subject: Tablespace clause and CREATE TABLE
PostPosted: Tue Dec 21, 2004 4:04 pm 
Beginner
Beginner

Joined: Wed Nov 03, 2004 6:24 pm
Posts: 24
[b]Hibernate version:[/b]
2.1.6
[b]Mapping documents:[/b]
Not applicable
[b]Code between sessionFactory.openSession() and session.close():[/b]
Not applicable
[b]Full stack trace of any exception that occurs:[/b]
Not applicable
[b]Name and version of the database you are using:[/b]
DB2 390, DB2 400
[b]The generated SQL (show_sql=true):[/b]
Not applicable
[b]Debug level Hibernate log excerpt:[/b]
Not applicable

Question: Is there a way to code or configure Hibernate so that the tablespace clause appears as part of the CREATE TABLE statement that SchemaExport generates, or must a person who needs to use the tablespace clause create tables outside of Hibernate?

Thank you!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 21, 2004 8:15 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
What is a tablespace clause?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 22, 2004 4:24 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i think he means schema - so look for schema in the docs.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Information about tablespaces and CREATE TABLE
PostPosted: Wed Dec 22, 2004 10:19 am 
Beginner
Beginner

Joined: Wed Nov 03, 2004 6:24 pm
Posts: 24
Thank you for reading and replying to my post. Here is some information about tablespaces and how they are used in the CREATE TABLE statement for DB2. With this information, can you help me determine a user can supply tablespace names to Hibernate (e.g., via a mapping document) so that Hibernate includes the names on the CREATE TABLE statements it generates? I have been using the SchemaGeneration tool to generate CREATE TABLE statements. Thank you very much!

An abstraction of a collection of containers into which database objects are stored. A container can be a directory, device or file. A table space provides a level of indirection between a database and the tables stored within the database. A table space has space on media storage devices assigned to it. The data, index, long field, and LOB portions of a table can be stored in the same table space, or can be individually broken out into separate table spaces.

Specifying which table space will contain a table’s index can only be done when the table is created.

The standard practice for creating tables in a particular table space, other than the default table space (USERSPACE1), is to supply the table space name as part of the CREATE TABLE command. For example, to create a table T1 in table space TS1, the following DDL statement would be used:
CREATE TABLE T1 (c1 INT) IN TS1;


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 22, 2004 10:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
sorry no - we don't support that notion.

we support catalog and schema.

So, you have a user that has a schema that is split across multiple table spaces ? (I normally recommend one schema to one tablespace - but that is just me, and I know real life can lead to other things ,)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Tablespace clause for CREATE TABLE
PostPosted: Wed Dec 22, 2004 12:22 pm 
Beginner
Beginner

Joined: Wed Nov 03, 2004 6:24 pm
Posts: 24
How would an individual or organization go about requesting to add support for syntax like the tablespace clause to Hibernate? Thank you!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 22, 2004 12:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you got a couple of options ,)

1. through commercial support
2. add it as a request to the JIRA
3. provide a patch for it

but note that i don't think that it will be included unless
it is a somewhat usable thing on more than one db (and
also somewhat generic) - but
I don't know ... not just up to me ,)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 22, 2004 1:03 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
tablespace clause exits in oracle and postgresql (postgresql from version 8).
It is about space for objects (tables, indexes) and not for user and schema.
For big database it is important features

regards


Top
 Profile  
 
 Post subject: Tablespace clause for CREATE TABLE
PostPosted: Wed Dec 22, 2004 1:31 pm 
Beginner
Beginner

Joined: Wed Nov 03, 2004 6:24 pm
Posts: 24
Thank you for all your quick responses!

Could you tell me more about "commercial support"? What does it mean? For example, would it mean contacting JBoss Inc? Could you tell me where I could learn more about commercial support and how to obtain it? Would I start here:

http://www.hibernate.org/148.html ???

Another option you mention is "provide a patch". I assume that means that I would modify Hibernate and turn my modifications (changes) over to Hibernate so they could be made part of Hibernate (assuming the changes were acceptable)?

Thank you!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 22, 2004 1:33 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yup (to both questions ,)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: create table with hibernate
PostPosted: Thu Jan 06, 2005 3:39 am 
Newbie

Joined: Fri Nov 19, 2004 12:17 am
Posts: 5
hi,
you can do one thing that you get the connection from your hibernate session and use the create table query in sql with connection and close the connection.
this will give you the following advantage.
1. no datasource is require for load database driver so the loading and making connection time will be saved.

but be care full that your database user should have this privllage.

it is not good practice to create table from application this is the task of DBA.


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