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.  [ 5 posts ] 
Author Message
 Post subject: REVERSE DB - WHAT ABOUT ANT SCRIPTS?
PostPosted: Mon Oct 23, 2006 1:20 pm 
Newbie

Joined: Mon Oct 23, 2006 1:17 pm
Posts: 5
Hi all,
i need an ant's scipt for reverse engineering of db with a lot of tables: i wold like generete hbm.xml files or java classes.

Have you something like that?

Regards


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 2:08 pm 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
http://www.hibernate.org/hib_docs/tools ... l/ant.html


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 24, 2006 5:03 am 
Newbie

Joined: Mon Oct 23, 2006 1:17 pm
Posts: 5
Ananasi wrote:
http://www.hibernate.org/hib_docs/tools/reference/en/html/ant.html


Hi, i've made a simple ant script for generete mapping files from tables
but i've the error below.

note that i've put in the classpath all of hibernate libs and jbdc driver for oracle.

<!--
ant script per generare file di mapping e oggetti java
a partire dallo schema
-->

<project name="HBReverse" default="HBReverse" basedir=".">
<property file="./properties/reverse.properties"/>
<property name="lib" value=""/>
<property name="hblib" value=""/>
<property name="hbconf" value=""/>
<property name="package.name" value=""/>
<property name="reverse.file" value=""/>
<property name="reverse.engine.class" value=""/>
<property name="detectemanytomany" value=""/>
<property name="detectoptimisticlock" value=""/>
<property name="hbm.dest.dir" value=""/>

<property name="project.name" value="HBReverse"/>


<path id="toolslib">
<fileset dir="${hblib}">
<include name="**/*.jar" />
<include name="**/*.properties" />
</fileset>
<fileset dir="${lib}">
<include name="**/*.jar" />

</fileset>
</path>

<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib" />


<hibernatetool>

<jdbcconfiguration
propertyfile = "${hbconf}"
packagename = "${package.name}"
revengfile = "${reverse.file}"
detectmanytomany = "${detectemanytomany}"

>
</jdbcconfiguration>
<hbm2hbmxml destdir="${hbm.dest.dir}" />
</hibernatetool>

<target name="reverse" >

</target>


</project>


######################################
# FILE DI PROPERTIES PER LO SCRIPT #
# reverse.xml #
######################################

# dir con le libs comuni (obbligatorio)
lib=p:/arete/libs/

# dir con le libs di hibernate (obbligatorio)
hblib=p:/arete/libs/hibernate/

# file di configurazione hibernate da utilizzare (obbligatorio)
hbconf=../metadata/hibernate.cfg.xml


# nome del package per le classi generate (obbligatorio)
package.name=it.sailing.hb.hbo


# nome del file xml con i parametri per il reverse (opzionale)
reverse.file=

# nome della classe che implementa org.hibernate.cfg.reveng.ReverseEngineeringStrategy
# (da utilizzare per implementare una strategia di reverse custom)
#reverse.engine.class=

# flag per determinare le relazioni many to many (obbligatorio)
detectemanytomany=false

# flat per determinare il lock ottimistico (obbligatorio)
detectoptimisticlock=true

# dir di destinazione per i files di mapping *.hbm.xml
hbm.dest.dir=../metadata/hbm




<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">**</property>
<property name="hibernate.connection.user">**</property>
<property name="hibernate.connection.password">**</property>
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
</session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 24, 2006 8:40 am 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
What was the error?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 24, 2006 9:00 am 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
At an initial glance, you are using an hibernate.cfg.xml for the propertyfile attribute of the jdbcconfiguration. Either use configurationfile =hibernate.cfg.xml or change the cfg.xml to a properties file and use propertyfile=hibernate.properties.


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