-->
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: Xdoclet-hibernet-xml files
PostPosted: Sun Sep 28, 2003 1:24 pm 
Beginner
Beginner

Joined: Sun Sep 07, 2003 9:04 am
Posts: 48
Hello forum, well my week-end is gone,so I need a help.
I want to generated Cat.hbm.xml and
hibernate.cfg.xml.
and here is my build.xml
when i run it I get build succesfull but nothing is generated.
I have xdcolet tag in the java files.
thanks

*************************************************************
<project name="queryexamples" default="compile">

<description>Hibernate Articles: Query Examples</description>

<!-- Global -->
<property name="classes" location="classes"/>
<property name="lib" location="lib"/>
<property name="src" location="src"/>
<property name="xdoclet.lib.home" value="C:\XDOCLETMAIN\xdoclet-bin-1.2b3\lib"/>

<property name="hibernate.lib.home" value="C:\hibernate-2.1beta3b\hibernate-2.1\lib"/>

<!--<property name="hibernate.lib.home" value="C:/java_api/hibernate-2.0/lib"/>-->
<!-- SchemaExport -->
<!-- <property name="mapping.files" location="${classes}/hibernate.cfg.xml"/>-->

<property name="db.dialect" value="net.sf.hibernate.dialect.Oracle9Dialect"/>
<property name="db.driver" value="oracle.jdbc.driver.OracleDriver"/>
<property name="db.url" value="jdbc:oracle:thin:@localhost:1521:PUS"/>
<property name="db.user" value="SOFUS"/>
<property name="db.password" value="sofus"/>

<path id="samples.class.path">
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
<fileset dir="${xdoclet.lib.home}">
<include name="*.jar"/>
</fileset>
<fileset dir="${hibernate.lib.home}">
<include name="*.jar"/>
</fileset>

</path>





<target name="init">
<taskdef
name="hibernatedoclet"
classname="xdoclet.modules.hibernate.HibernateDocletTask"
classpathref="samples.class.path"
/>


</target>

<!-- =================================================================== -->
<!-- Invoke XDoclet's hibernate -->
<!-- =================================================================== -->


<target name="hibernate"
description="Generates Hibernate class descriptor files.">
<taskdef name="hibernatedoclet"
classname="xdoclet.modules.hibernate.HibernateDocletTask">
<classpath>
<fileset dir="${xdoclet.lib.home}">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>

<!-- Execute the hibernatedoclet task -->
<hibernatedoclet
destdir="${classes}"
excludedtags="@version,@author,@todo"
force="true"
verbose="true"
mergedir="${classes}">

<fileset dir="${src}">
<include name="**/*.java"/>
<include name="**/dbdemo/*.java"/>

</fileset>

<hibernate version="2.0"/>

</hibernatedoclet>
</target>







<target name="compile"
description="Compiles source files to build directory."
depends="clean">
<mkdir dir="${classes}"/>
<javac srcdir="${src}" destdir="${classes}">
<classpath>
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
</target>


<target name="clean"
description="Removes build directory.">
<delete dir="${classes}/net"/>
</target>



<target name="all" depends="initdb.postgres,hibernate,init,compile">
</target>



<target name="initdb.postgres"
description="Generates the database schema for PostgreSQL."
depends="compile">
<java classname="net.sf.hibernate.tool.hbm2ddl.SchemaExport" fork="true">

<!-- Hibernate Properties -->
<jvmarg value="-Dhibernate.dialect=${db.dialect}"/>
<jvmarg value="-Dhibernate.connection.driver_class=${db.driver}"/>
<jvmarg value="-Dhibernate.connection.url=${db.url}"/>
<jvmarg value="-Dhibernate.connection.username=${db.user}"/>
<jvmarg value="-Dhibernate.connection.password=${db.password}"/>

<!-- Mapping Files -->
<!--<arg value="${mapping.files}"/>-->

<classpath>
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
<!-- Application Classpath -->
<pathelement location="${classes}"/>
</classpath>

</java>
</target>


</project>




*************************************************************


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 28, 2003 10:01 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Check out the tools example
http://www.hibernate.org/hib_docs/examples/

We spent some time building this example at JAOO to illustrate the toos and how to use them. Ant is the primary driver.


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.