-->
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: create schema on first startup
PostPosted: Wed Aug 01, 2007 5:23 am 
Newbie

Joined: Thu Jul 19, 2007 4:18 am
Posts: 5
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

[b]Hibernate version:.3.2

Hi, I have problem when start my hibernate application for the first time. I want create Db or Db schema if these not exist.

In the hibernate configuration file, if I use the property <property name="hibernate.hbm2ddl.auto">create</property> the application drop and re-create the schema every starup.

If I try to use the property <property name="hibernate.hbm2ddl.auto">update</property> the application don't re-create the db schema at the startup (and it's good) but if I drop the schema I have the exception: org.hibernate.util.JDBCExceptionReporter Base table or view not found message from server: "La tabella 'lemuredb.tree' non esiste"

This is the configuration file:

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="hibernate.connection.url">
jdbc:mysql://localhost/lemuredb
</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">
org.hibernate.dialect.MySQLInnoDBDialect
</property>

<property name="current_session_context_class">thread</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- Mapping files -->
<mapping resource="Nodes.hbm.xml" />
<mapping resource="Tree.hbm.xml"/>
<mapping resource="Company.hbm.xml"/>
</session-factory>
</hibernate-configuration>

thanks for all


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.