Christian Meunier wrote:
Oliver Wehrens wrote:
Hi,
as I wrote earlier I had a problem with the anttask not finding my
classes (since separation
of classes/mappinfiles). I'm now using the java task to run the main
method of SchemaExport.
To make things easier I added a switch to the commandline where one
can specify the
directory which holds the mappingfiles. The switch loads all
mappingfiles (ending with .hbm.xml)
to the hibernateconfiguration.
The ant target for creating the ddl would look like:
</target name="createdatabase">
<java classname="net.sf.hibernate.tool.hbm2ddl.SchemaExport"
fork="yes">
<arg value="--mappingdir=dir/to/mappingfiles/"/>
<arg value="--quiet"/>
<arg value="--properties=build/hibernate.properties"/>
<classpath refid="classpath"/>
</java>
</target>
Later I might change the ant-task schemaexport as well to have a
classpath (which looks like the cleaner solution).
Maybe somebody finds that interesting and will apply that to the
hibernate source. This is a patch against
the latest hibernate source from today (a.k.a 2.0.2).
I dont know if my issue is related or not but i cant make schemaExport
to work, the error is always the same:
-> Schema text failed: persistent class not found:
ch.orbital.fiberhome.domain.CRMToken
My ant task is as follow:
<target name="schemaexport" description="Génération du dll pour la
création du schema" depends="generate" >
<schemaexport
properties="${src}/etc/hibernate.properties"
quiet="no"
text="no"
drop="no"
delimiter=";"
output="${build}/schema-export.sql">
<fileset dir="${build}/java">
<include name="**/*.hbm.xml"/>
</fileset>
</schemaexport>
</target>
with the following files:
C:\dev\fiberhome\build\java\ch\orbital\fiberhome\domain\CRMToken.hbm.xml
C:\dev\fiberhome\build\java\ch\orbital\fiberhome\domain\CRMToken.class
The other weird thing is that the task complains it cant find the
hibernate.properties file however the file exists and the path is
correct :
20 août 2003 13:34:11 net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.0.2
20 août 2003 13:34:11 net.sf.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found <-----
Finally, i use the xml file (hibernate.cfg.xml) wiht hibernate, the
schemaexport / schemaUpdate should be able to use the xml file as well
so i dont have to create a dummy hibernate.properties for those tasks.
Thanks in advance for your help.
Christian Meunier
Resolved my issue, stupid class patch one, as for the
hibernate.properties file not being found, hibernate find it properly
and is able to create my schema in the database so i dont understand why
hibernate output this message.
Regards
Christian Meunier
-------------------------------------------------------
This SF.net email is sponsored by Dice.com.
Did you know that Dice has over 25,000 tech jobs available today? From
careers in IT to Engineering to Tech Sales, Dice has tech jobs from the
best hiring companies. http://www.dice.com/index.epl?rel_code4
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel