-->
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: How to print Create table script using hibernate?
PostPosted: Tue Mar 01, 2011 6:22 am 
Newbie

Joined: Wed Jan 19, 2011 6:30 am
Posts: 10
Hi All,

I have created hbm file which contains all mapping.
Now when I run my main() function, if tables which are define in .hbm file not present in DB then hibernate create for me, that's good one.
But Now I want to print that all Create table script.
I have try with
Code:
<property name="show_sql">true</property>
in .cfg file and
Code:
log4j.logger.org.hibernate.SQL=true
in log4j.properties, but still I didn't get Create script.
Using above property, it prints all insert, update, delete script but I want Create table script also.

.cfg file
Code:
<hibernate-configuration>
<session-factory>
      <property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
      <property name="hibernate.connection.url">jdbc:sqlserver://192.168.1.214:1533</property>
      <property name="hibernate.connection.username">DEV_RFG_ANALYTIX4</property>
      <property name="hibernate.connection.password">DEV_RFG_ANALYTIX4</property>
      <property name="hibernate.connection.pool_size">10</property>
      <property name="show_sql">true</property>
      <property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
      <property name="hibernate.hbm2ddl.auto">update</property>
      <!-- Mapping files -->
      <mapping resource="HibernateMapping.hbm.xml"/>   
</session-factory>
</hibernate-configuration>


Can any one know about this?

Thank You,
Navnath Kumbhar.


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.