-->
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.  [ 30 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Is schemaexport documented somewhere?
PostPosted: Sat Sep 27, 2003 4:40 pm 
Beginner
Beginner

Joined: Sat Sep 20, 2003 4:23 am
Posts: 48
If so, I'm unable to find it :(


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 27, 2003 5:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
search for "schemaexport" in the documentation ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 27, 2003 5:59 pm 
Beginner
Beginner

Joined: Sat Sep 20, 2003 4:23 am
Posts: 48
Thanks, I just found it

Still I have some questions: I'm not using a hibernate.properties, instead everything is configured with my hibernate.cfg.xml file, can I specify that one instead?

Also: in the documentation only jdbc is explained, can you also use a JNDI datasource instead?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 27, 2003 6:07 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Yes, the option is "--config=hibernate.cfg.xml", I just added it to the documentation. Well, you may propably also use the JNDI bound SessionFactory, but have to bind it yourself before calling SchemaExport.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 27, 2003 6:18 pm 
Beginner
Beginner

Joined: Sat Sep 20, 2003 4:23 am
Posts: 48
thanks!

Anyway, still a problem:

Quote:
BUILD FAILED
file:/Users/iljahehenkamp/Documents/Projecten/Mathesis/build.xml:582: Reference class.path not found.


I guess I have to setup a pathreference in my build file, however I'm not so sure how to do that when my hibernate2.jar is in my $CATALINA_HOME/common/lib directory. Any tips?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 27, 2003 6:22 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Ilja wrote:
I guess I have to setup a pathreference in my build file, however I'm not so sure how to do that when my hibernate2.jar is in my $CATALINA_HOME/common/lib directory. Any tips?


Yes, set up your class path in the build file. And don't place Hibernate or anything else (only JDBC drivers) in the common/lib under Tomcat.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 27, 2003 6:27 pm 
Beginner
Beginner

Joined: Sat Sep 20, 2003 4:23 am
Posts: 48
christian wrote:
Ilja wrote:
I guess I have to setup a pathreference in my build file, however I'm not so sure how to do that when my hibernate2.jar is in my $CATALINA_HOME/common/lib directory. Any tips?


Yes, set up your class path in the build file. And don't place Hibernate or anything else (only JDBC drivers) in the common/lib under Tomcat.


sorry, to be so ignorant, but do you have an example on how to setup a classpath? Do you have to reference just your extension directory or the particular .jar files?

And where do I place my hibernate2.jar? in my WEB-INF/lib dir?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 27, 2003 6:30 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Read the "Hibernate & Tomcat Quickstart" article. If you'd like to have a copy paste example and the existing one on the Wiki community area is not good enough, you have to wait another hour. I'm just preparing the slides from our Toolset workshop for the website.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 27, 2003 6:47 pm 
Beginner
Beginner

Joined: Sat Sep 20, 2003 4:23 am
Posts: 48
I cannot find it *yet*, so an cut 'n past example would be nice. Take your time though, I'm not in a hurry :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 27, 2003 6:52 pm 
Beginner
Beginner

Joined: Sat Sep 20, 2003 4:23 am
Posts: 48
Another quick question: is it possible to just let it generate the script and not executing it?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 27, 2003 6:53 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Yes.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 27, 2003 7:13 pm 
Beginner
Beginner

Joined: Sat Sep 20, 2003 4:23 am
Posts: 48
thanks, found it (should have looked better...)

Quote:
text="yes"


started fiddling around with this classpath thingy, have now this:

Code:
<target name="create-database" depends="compile, generate-mappings">

  <classpath>
      <pathelement path="${lib.home}"/>
      <pathelement location="hibernate2.jar"/>
    </classpath>

<taskdef name="schemaexport"
     classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
     classpathref="class.path"/>

<schemaexport
     config="${src.home}/hibernate.cfg.xml"
     quiet="no"
     text="yes"
     drop="no"
     format="yes"
     delimiter=";"
     output="${build.home}/schema-export.sql">
     <fileset dir="${build.home}">
         <include name="**/*.hbm.xml"/>
     </fileset>
</schemaexport>
</target>


lib.home is defined here:

Code:
<property name="lib.home" value="${web.home}/WEB-INF/lib"/>


but then I get the following error:

Quote:
BUILD FAILED
file:/Users/iljahehenkamp/Documents/Projecten/Mathesis/build.xml:581: Could not create task or type of type: classpath.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 27, 2003 7:23 pm 
Beginner
Beginner

Joined: Sat Sep 20, 2003 4:23 am
Posts: 48
this doesn't work either:

Code:
<taskdef name="schemaexport"
     classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
     classpath="${lib.home}/hibernate2.jar"/>


also have tried this:

Code:
  <path id="class.path">
     <pathelement location="${lib.home}/hibernate2.jar"/>
  </path>


in combination with:

Code:
<taskdef name="schemaexport"
     classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
     classpathref="class.path"/>


without luck :(


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 27, 2003 7:39 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://www.hibernate.org/hib_docs/examples/

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 27, 2003 7:48 pm 
Beginner
Beginner

Joined: Sat Sep 20, 2003 4:23 am
Posts: 48
Thanks, but haven't found any reference or example of this class.path?

Sorry for being such a pain in the ass :(


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 30 posts ]  Go to page 1, 2  Next

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.