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.  [ 1 post ] 
Author Message
 Post subject: hbm2ddl Tool and Generated DDL
PostPosted: Thu Oct 05, 2006 11:13 am 
Newbie

Joined: Thu Oct 05, 2006 10:57 am
Posts: 1
I'm using the hbm2ddl Ant task to generate the DDL for my entities. I have several entities that are using an inheritance type of JOINED. I know Hibernate does not require the DiscriminatorColumn annotation so have purposely omitted this. However, when I generate the DDL using the Ant task I do not see the primary key columns or foreign key constrains for the subclassed entities.

For example, I have the standard Employee and FTEmployee sample. The Employee entity is an abstract class and has inheritance set to JOINED. FTEmployee extends Employee. When I generate the DDL the FTEmployee table only features the attribute columns and not the PK. In fact, the PK column and FK constraint are not created until I run up the application (assuming hbm2ddl.auto is set correctly). Even then I do not see any DDL being issued (like, "ALTER TABLE...") when show_sql is set to "true".

Is this by design? If the generated DDL is not complete then what is the point of it? I would expect the full DDL to be generated, including all columns, all constraints and all indexes, so that I could create the database without having to execute the application. Also, creating a table without a PK is just wrong, isn't it? Or have I missed something?

Thanks in anticipation.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.