Bonjour à tous,
Voila j'ai déjà eu l'occasion d'utiliser les schemaexport d'Hibernate 2.x avec ant.
Désormais je travaille avec Hibernate 3.0 et la génération me pose un problème voici ma config (j'ai supprime des choses pour que cela soit plus clair)![]()
Voici l'arborescence Hibernate du projet
Hibernate config
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 src |----com.toto.projectname.conf.hibernate |----hibernate.cfg.xml |----mapping |--dimension.hbm.xml
Target ant
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.datasource">java:comp/env/projectname</property> <property name="show_sql">false</property> <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property> <!-- Mapping files --> <mapping resource="mapping/dimension.hbm.xml"/> </session-factory> </hibernate-configuration>
Je lance le schemaexport via la commande
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 <target name="schemaexport" depends="compile"> <taskdef name="schemaexport" classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" classpathref="class.path"/> <schemaexport config="com.toto.projectname.conf.hibernate/hibernate.cfg.xml" quiet="no" text="no" drop="no" delimiter=";" output="schema-export.sql"> </schemaexport> </target>
Et l'erreur retournée c'est "impossible de trouver le ficher mapping/dimension.hbm.xml"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 ant schemaexport
Je faisais la même chose sous Hibernate 2 et ca passait, je ne dois pas avoir les yeux en face des trous
Si quelqu'un peut m'aider...
Merci d'avance
Partager