-->
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.  [ 4 posts ] 
Author Message
 Post subject: How to generate Oracle specific DDL using hbm2ddl?
PostPosted: Sat Apr 12, 2008 1:27 pm 
Newbie

Joined: Sat Apr 12, 2008 12:44 pm
Posts: 2
Hello,

I am using hbm2ddl tool for generating "create schema" script for production system which will work with huge amount of data. I am solving a performance problem now. I can improve the performance by using of some Oracle specific DDL statements in create script but I have not found an easy way how to generate Oracle specific DDL with hbm2ddl (or another tool).

For example I need to generate indices on foreign keys or I want to determine in which tablespace should be given table added.

I realize that the metadata desciption tools (annotations or XML mapping files) have to be generic but I speculate if there can be some possibility to append some piece of vendor-specific DDL to generated DDL.

This problem can be also solved using another approach - using another anotation-processing tool which will have its own set of annotations allowing generation of Oracle specific DDL.

I have not found suitable tool or some "best practice" how to do that so I am asking this question before I start to implement some utility which will allow doing this by hand.

I know that my question is quite generic, but I will be grateful for every hint or experience in solving above mentioned problems.

Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 12, 2008 2:07 pm 
Senior
Senior

Joined: Mon Feb 25, 2008 1:48 am
Posts: 191
Location: India
I hope you are using the right dialect. The dialect that u use will make your DDL specific to the vendor you want. For Oracle there is OracleDialect as well Oracle9iDialect. For MySQl it is the MySQLDialect. You can read the documentation for all the dialects supported. You can also extend and an existing dialect as customize them as per your need and then use that dialect to generate your DDLs from your mapping files using hbm2ddl hibernate tool

_________________
Sukirtha


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 12, 2008 3:32 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
But no...we don't have a good way of adding propritary elements to the output.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 13, 2008 3:27 pm 
Newbie

Joined: Sat Apr 12, 2008 12:44 pm
Posts: 2
Sukirtha and max, thank you for your answers. Extension of dialect sounds very attractive but I think that this approach will have to solve (as well as other approaches using standard Hibernate tools) the lack of metadata information in generic annotations (or mapping files).

For now I am thinking about using hbm2ddl for generation of standard DDL create script and after that it will be necessary to use some tool which will add some specific DDL clauses into this script. This clauses will be generated on the basis of vendor-specific annotations (which will be defined for this purpose by hand).

But all of this will depend on costs for development of such tool.


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