Announcement Announcement Module
Collapse
No announcement yet.
When hbm2ddl= create, I want DDL written to a file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • When hbm2ddl= create, I want DDL written to a file

    Hi Guys,

    In development, I succesfully have hibernate configured to create tables automatically by configuring Hibernate in Spring as shown below, basically setting <prop key="hibernate.hbm2ddl.auto">create</prop>
    But for creating schema in live database , I want save the DDL to a file rather than run it automatically, editing some of the DDL. Is this possible when Hibernate is configured in Spring (I know there is a maven plugin, but it depends on Hibernate being configured without benefit of Spring)

    Thanks in advance, Eliot






    <bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.annotati on.AnnotationSessionFactoryBean">
    ... <property name="configurationClass">
    <value>org.hibernate.cfg.AnnotationConfiguration </value>
    </property>

    <property name="annotatedClasses">
    <list>
    ... </list>
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.hbm2ddl.auto">create</prop>
    </props>
    </property>
    </bean>
Working...
X