-->
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: Schema export generate emplty ddl for MySQL db
PostPosted: Wed Feb 15, 2006 12:32 pm 
Beginner
Beginner

Joined: Wed Aug 27, 2003 8:53 pm
Posts: 34
I try to generate schema using hibernate schema export, everything looks fine. But I got the following error, and an empty ddl file genarated:


Hibernate version:3.1.2


Name and version of the database you are using:MySQL 5.0.18

hibernate.config.xml:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

<session-factory>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/ts</property>
<property name="connection.username">user</property>
<property name="connection.password">password</property>

<property name="hibernate.connection.datasource">jdbc/dbs</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>

<property name="hibernate.current_session_context_class">org.hibernate.context.JTASessionContext</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

<property name="jdbc.user_scrollable_resultset">false</property>
<property name="jdbc.use_streams_for_binary">true</property>
<property name="jdbc.batch_size">0</property>

<!-- Drop and re-create the database schema on startup
<property name="hbm2ddl.auto">create</property>
-->

<!-- mapping files -->

<mapping resource="com/info/beans/ParentTree.hbm.xml" />

<mapping resource="com/info/beans/ChildTree.hbm.xml" />

</session-factory>
</hibernate-configuration>




Ant target:
<target name="schemaexport" depends="build">
<taskdef name="schemaexport"
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
classpathref="libraries"/>

<schemaexport
properties="hibernate.properties"
quiet="no"
text="no"
drop="no"
delimiter=";"
output="dbs.ddl">
<fileset dir="${build}">
<include name="**/*.hbm.xml"/>
</fileset>
</schemaexport>
</target>



stack trace from ant -debug:
Class java.lang.Error loaded from parent loader (parentFirst)
Couldn't load ResourceStream for import.sql
Couldn't load ResourceStream for import.sql
....................
Class org.hibernate.connection.DriverManagerConnectionProvider loaded from ant loader (parentFirst)
Finding class com.mysql.jdbc.Driver
Finding class com.mysql.jdbc.Driver
..............
Class org.apache.log4j.spi.VectorWriter loaded from ant loader (parentFirst)

BUILD SUCCESSFUL
Total time: 2 seconds


thanks,


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.