-->
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.  [ 6 posts ] 
Author Message
 Post subject: hbm2ddl with hibernate.cfg.xml (dialect not set)
PostPosted: Sun Oct 24, 2004 6:47 pm 
Newbie

Joined: Sun Oct 24, 2004 5:59 pm
Posts: 3
Hi,

I use xdoclet to generate hbm.xml file then the schemaexport task to create the database schema.
This task fails when I use the hibernate.cfg.xml file.

I try to use a hibernate.properties file and update the target with <schemaexport properties=hibernate.properties ...., then all goes right

Is there a solution to use the hibernate.cfg.xml instead of the hibernate.properties to create the database schema????

thank's in advance

hibernate version: 2.1.6

<session-factory>

<!-- properties -->
<property name="dialect">net.sf.hibernate.dialect.SQLServerDialect</property>
<property name="show_sql">false</property>
<property name="use_outer_join">false</property>
<property name="connection.username">sa</property>
<property name="connection.password">sa</property>
<property name="connection.driver_class">com.inet.tds.TdsDriver</property>
<property name="connection.url">jdbc:inetdae7:localhost?database=test</property>

<!-- mapping files -->
<mapping resource="net/volfoni/model/party/Party.hbm.xml"/>
</session-factory>



The ant target :

<target name="schema-export" depends="generate-hibernate">
<taskdef name="schemaexport" classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
classpathref="lib.classpath" />
<schemaexport config="${codegen}/hibernate.cfg.xml"
quiet ="no"
text="no"
drop="no"
delimiter=";"
output="schema-export.sql" >
<fileset dir="${codegen}" >
<include name ="**/*.hbm.xml" />
</fileset>
</schemaexport>
</target>


[schemaexport] 25 oct. 2004 00:33:27 net.sf.hibernate.cfg.Environment <clinit>
[schemaexport] INFO: Hibernate 2.1.6
[schemaexport] 25 oct. 2004 00:33:27 net.sf.hibernate.cfg.Environment <clinit>
[schemaexport] INFO: hibernate.properties not found
[schemaexport] 25 oct. 2004 00:33:27 net.sf.hibernate.cfg.Environment <clinit>
[schemaexport] INFO: using CGLIB reflection optimizer
[schemaexport] 25 oct. 2004 00:33:27 net.sf.hibernate.cfg.Configuration configure
[schemaexport] INFO: configuring from file: hibernate2.cfg.xml
[schemaexport] 25 oct. 2004 00:33:27 net.sf.hibernate.cfg.Configuration addResource
[schemaexport] INFO: Mapping resource: net/volfoni/model/party/Party.hbm.xml
BUILD FAILED: C:\Program Files\eclipse\workspace\volfoni\build-hibernate.xml:64: Schema text failed: Resource: net/volfoni/model/party/Party.hbm.xml not found
Total time: 3 seconds


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 24, 2004 9:38 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Try using a leading '/' on the path for the configuration file.
eg
Code:
<schemaexport config="/${codegen}/hibernate.cfg.xml"


Top
 Profile  
 
 Post subject: no more chance
PostPosted: Mon Oct 25, 2004 6:05 pm 
Newbie

Joined: Sun Oct 24, 2004 5:59 pm
Posts: 3
Thank's, but I try this to but no chance. The same result comes


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 25, 2004 7:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I use it from a cfg file and it works fine. Just have to work out the path. The tools demo package we created a year ago also used the cfg configuration. Maybe have a look at it and it might give you some guidence.


Top
 Profile  
 
 Post subject: no more result
PostPosted: Wed Oct 27, 2004 7:13 pm 
Newbie

Joined: Sun Oct 24, 2004 5:59 pm
Posts: 3
I look at the classpath, but no more result.
Where I can find the demo that you talk about. I could find some help in it....

Thank's for your time


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 7:48 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
See http://hibernate.bluemars.net/159.html
at the bottom or download from http://www.hibernate.org/hib_docs/online/workshop_toolset/workshop_toolset_java.tar.gz


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

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.