-->
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: Hibernate et génération auto du schéma de base de données
PostPosted: Fri Jun 11, 2010 11:28 am 
Newbie

Joined: Fri Jun 11, 2010 11:08 am
Posts: 2
Salut,
Je suis entrain d'essayer de générer le schéma de la base de données depuis les fichier de mapping hibernate (fichier hbm.xml) en intégrant un script dans le fichier build.xml de mon projet;;Voici le script que j'ai mis dans le fichier de build;;;

<target name="schemaexport" depends="compile">
<taskdef name="schemaexport"
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
classpathref="libraries" />
<schemaexport
config="${basedir}/src/hibernate.cfg.xml"
quiet="no"
text="yes"
delimiter=";"
create="yes"
output="${basedir}/generated-schema.sql"
includes="**/*.hbm.xml"/>
</target>


et le fichier de configuration cfg.xml;;;;


<hibernate-configuration>

<session-factory>

<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/BaseT</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>

<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>

<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

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

<mapping resource="events/Event.hbm.xml"/>

</session-factory>

</hibernate-configuration>


le problème ce que j'ai toujours la même faute

C:\Documents and Settings\workspace\testSchExp\build.xml:50: Schema text failed: resource: events/Event.hbm.xml not found

j'ai pas compris exactement où c'est la faute

Merci Bien D'avance pour votre aide


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.