Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: Hibernate Tools 3.2.0.beta7
Mapping documents: Generated
Code between sessionFactory.openSession() and session.close(): N/A
Full stack trace of any exception that occurs: N/A
Name and version of the database you are using: Oracle 9.2.0.7.0
The generated SQL (show_sql=true): N/A
Debug level Hibernate log excerpt: N/A
Problems with Session and transaction handling? N/A
Read this:
http://hibernate.org/42.html
Hi,
Implementation Description: Using Hibernate Tools to generate *.hbm.xml files from Oracle database tables with ant task (not eclipse). Modules provided are ant build.xml, hibernate.cfg.xml, reveng.xml (please see below).
Problem Description: If the schema name is ommitted, the <table> declaration is ignored in the reveng.xml file, when generating *.hbm.xml files. The schema can be defined in the hibernate.cfg.xml (default_schema), or the reveng.xml <table> element (schema attribute). No warning or error is reported when the <table> element is not used. If the schema name is required, a warning message when the <table> element is encountered would be very helpful.
Related Information: Tools forum issue "Hibernate Reverse Engineering Tool ignores reveng.xml file" (rahulpilani, 24/04/06) reports that if the schema is defined as a default, and
also in the <table> element, this also causes an issue.
best regards,
Aidan Russell
Munich, Germany
------------------------ hibernate.cfg.xml ---------------------------
Code:
<?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>
<!-- Database connection settings -->
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@soriqsv10.qsu.fm.hypovereinsbank.de:1521:HVGDT2</property>
<property name="connection.username">tugd002</property>
<property name="connection.password">tugd002</property>
<!-- <property name="default_schema">TUGD001</property> -->
<!-- JDBC connection pool (use built-in) -->
<property name="connection.pool_size">1</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">false</property>
<!-- Drop and re-create the database schema on startup -->
<!-- <property name="hbm2ddl.auto">create</property> -->
</session-factory>
</hibernate-configuration>
-------------------------------------- reveng.xml -------------------------------
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering
SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd">
<hibernate-reverse-engineering>
<table-filter match-name="T_INDEX_HEADER" exclude="false" package="com.ted.HBMTools1.db"/>
<table name="T_INDEX_HEADER" schema="TUGD001">
<primary-key>
<key-column name="RIC" type="string"></key-column>
</primary-key>
<column name="ISIN" type="string"/>
<column name="INDEXNAME" type="string"/>
<column name="INDEXTYPE" type="string"/>
</table>
</hibernate-reverse-engineering>
------------------------------------ ANT build.xml -----------------------------
Code:
<project name="HBMTools1" default="clean">
<property file="build.properties"/>
<property name="targetdir" value="${basedir}/generated"/>
<property name="librarydir" value="${basedir}/lib"/>
<property name="hbmtoolslibrarydir" value="${basedir}/../hbmtools_master_lib"/>
<path id="libraries">
<fileset dir="${librarydir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${hbmtoolslibrarydir}">
<include name="*.jar"/>
</fileset>
</path>
<target name="clean">
<delete dir="${targetdir}"/>
<mkdir dir="${targetdir}"/>
</target>
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="libraries"/>
<hibernatetool destdir="${targetdir}">
<jdbcconfiguration
packagename="com.ted.HBMTools1.db"
revengfile="reveng.xml"
configurationfile="hibernate.cfg.xml"/>
<hbm2hbmxml/>
</hibernatetool>
<target name="hibernatetool">
</target>
</project>