-->
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: Offline SchemaExport
PostPosted: Wed May 11, 2005 10:14 am 
Beginner
Beginner

Joined: Mon Jul 05, 2004 9:29 am
Posts: 38
Hibernate version: 2.1.7

Hi, I would like to have a simple answer to a simple question: is it possible to generate the database ddl with SchemaExportTask without actually connect to the database? In my development environment, a firewall prevents me to access the database directly, I have to generate the DDL and give it to our database manager. I don't really see why a connection should be required for such a task.

Thank you very much,
Xavier

PS: I got another problem with the SchemaExportTask, from the hibernate 2.x manual paragraph 15.1.4. "Using Ant", it is said:

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.


It doesn't work for me, having such the following line in my ant build.xml before calling the SchemaExportTask results in a error like "Schema text failed: The dialect was not set. Set the property hibernate.dialect."

Code:
<property name="hibernate.dialect" value="net.sf.hibernate.dialect.OracleDialect"/>

<schemaexport quiet="no" text="yes" drop="no" delimiter=";"/>


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 11, 2005 5:29 pm 
Regular
Regular

Joined: Mon Jun 14, 2004 1:42 pm
Posts: 80
Location: Brazil
Yes,you don't need to connect to the db.
Here is my ddl ant task example
Code:
<project name="pethotel" default="schemaexport" basedir=".">
<target name="schemaexport">
<taskdef name="schemaexport"
classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
>
<classpath>
<!-- put here classpath that includes you components too -->
</classpath>
</taskdef>
   <schemaexport
      properties="genDDL.properties"
      quiet="no"
      text="yes"
      drop="no"
      delimiter=";"
      output="schema-export.sql">
      <fileset dir="hbm/persistent">
         <include name="**/*.hbm"/>
      </fileset>
   </schemaexport>   
</target>
</project>

properties example
Code:
#
#Thu Apr 07 21:32:05 GMT-03:00 2005
hibernate.dialect=net.sf.hibernate.dialect.PostgreSQLDialect


_________________
Alexandre Torres
--------------------


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.