-->
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.  [ 2 posts ] 
Author Message
 Post subject: Ant task doesn't find hibernate.dialect property
PostPosted: Mon Feb 28, 2005 4:28 pm 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
All,

I can't seem to get my schemaexport task to run. It complains that that dialect was not set. Since I'm configuring Hibernate with Spring, I have no config file (either XML or properties).

Using Ant, I've tried setting the property both globally and in the actual target, but it doesn't seem to make a difference. Here are the snippets from my Ant file:

Code:
    <taskdef name="schemaexport" classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask">
       <classpath>
           <fileset dir="../duwi_libraries/hibernate-2.1.8">
              <include name="hibernate2.jar"/>
              <include name="lib/dom4j-1.4.jar"/>
              <include name="lib/commons-logging-1.0.4.jar"/>
              <include name="lib/commons-collections-2.1.1.jar"/>
           </fileset>
          <pathelement location="${bin.dir}"/>
       </classpath>
    </taskdef>


Code:
   <target name="gen-sql" depends="compile" description="Generate DDL script">
   <property name="hibernate.dialect" value="net.sf.hibernate.dialect.OracleDialect"/>
       <schemaexport quiet="no" text="no" drop="no" delimiter=";" output="schema.sql">
           <fileset dir="${src.dir}">
               <include name="**/model/*.hbm.xml"/>
           </fileset>
       </schemaexport>
   </target>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 10:13 am 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
I have scoured these forums and can't find any references to a user setting the properties in this manner (in Ant rather than props/XML file). Is it possible this feature is crippled or non-functional? The manual suggests that it works:

Quote:
If you don't specify properties or a config file, the SchemaExportTask will try to use normal Ant project properties instead. In other words, if you don't want or need an external configuration or properties file, you may put hibernate.* configuration properties in your build.xml or build.properties.


Here's the output from my Ant build. I'm really at a loss here:

Code:
[schemaexport] INFO: Hibernate 2.1.8
[schemaexport] Feb 28, 2005 5:08:21 PM net.sf.hibernate.cfg.Environment <clinit>

[schemaexport] INFO: hibernate.properties not found
[schemaexport] Feb 28, 2005 5:08:21 PM net.sf.hibernate.cfg.Environment <clinit>

[schemaexport] INFO: using CGLIB reflection optimizer
[schemaexport] Feb 28, 2005 5:08:21 PM net.sf.hibernate.cfg.Environment <clinit>

[schemaexport] INFO: using JDK 1.4 java.sql.Timestamp handling
[schemaexport] Feb 28, 2005 5:08:21 PM net.sf.hibernate.cfg.Configuration addFile
[schemaexport] INFO: Mapping file: C:\workspace\xxx-core\src\com\xxx\core\model\Cart.hbm.xml
[schemaexport] Feb 28, 2005 5:08:22 PM net.sf.hibernate.cfg.Binder bindRootClass

[schemaexport] INFO: Mapping class: com.xxx.core.model.Cart -> CART
[schemaexport] Feb 28, 2005 5:08:22 PM net.sf.hibernate.cfg.Configuration addFile
[schemaexport] INFO: Mapping file: C:\workspace\xxx-core\src\com\xxx\core\model\Order.hbm.xml
[schemaexport] Feb 28, 2005 5:08:22 PM net.sf.hibernate.cfg.Binder bindRootClass

[schemaexport] INFO: Mapping class: com.xxx.core.model.Order -> ORDER

BUILD FAILED
C:\workspace\xxx-core\build.xml:88: Schema text failed: The dialect was not set. Set the property hibernate.dialect.

Total time: 3 seconds


I can probably make do with a hibernate.properties file for now, but this will be confusing to the Hibernate newbies on my team because they may assume the file is used for runtime configuration of Hibernate.

-Chris


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.