[
http://opensource.atlassian.com/projects/hibernate/browse/HBX-578?page=all ]
Max Rydahl Andersen closed HBX-578:
-----------------------------------
Resolution: Incomplete
no further info - assuming mysql metadata issue.
<hbm2hbmxml/> doesn't take into account the revengfile
property for changing properties names on mapping
--------------------------------------------------------------------------------------------------------
Key: HBX-578
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-578
Project: Hibernate Tools
Type: Bug
Components: reverse-engineer
Versions: 3.1beta4
Reporter: David Leal
Priority: Critical
Attachments: ant.log
When using the property revengfile from <jdbcconfiguration> in order to change some
output on the generated file such changes are not considered on the generated *.hbml.xml
file.
Let's say the following simple ant build file in order to check the fail:
=============
ant build.xml file
=============
<project name = "hibernate-test">
<property name = "lib.dir" location="lib"/>
<path id="lib.classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<taskdef
name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="lib.classpath"
/>
<target name = "hibernatetool">
<hibernatetool destdir=".">
<classpath>
<path refid="lib.classpath"/>
</classpath>
<jdbcconfiguration
revengfile ="hibernate.reveng.xml"
configurationfile ="hibernate.cfg.xml"
/>
<hbm2hbmxml/>
</hibernatetool>
</target>
</project>
================
hibernate.reveng.xml file:
===================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering
SYSTEM
"http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
<!--Configuration file for controlling the inverse generation process from the
Database to
*.hbml and *.java files-->
<hibernate-reverse-engineering>
<table-filter
match-name="credit_entity"
exclude="false"
/>
<table name="credit_entity">
<column name="name" property="theName"
type="String" />
</table>
</hibernate-reverse-engineering>
================
hibernate.cfg.xml file:
================
<?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 name="lra">
<property
name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
<property
name="hibernate.connection.password">dev00</property>
<property
name="hibernate.connection.url">jdbc:mysql://localhost/lra</property>
<property
name="hibernate.connection.username">dev</property>
<property
name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
</session-factory>
</hibernate-configuration>
================
database script file:
================
CREATE TABLE credit_entity (
nif VARCHAR(10) NOT NULL
, name VARCHAR(40) NOT NULL
, PRIMARY KEY (nif)
);
ALTER TABLE credit_entity COMMENT='Credit entity information';
================
and the output file is:
================
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 07-feb-2006 0:16:45 by Hibernate Tools 3.1.0 beta3 -->
<hibernate-mapping>
<class name="CreditEntity" table="credit_entity"
catalog="lra">
<id name="nif" type="string">
<column name="nif" length="10" />
<generator class="assigned" />
</id>
<property name="name" type="string">
<column name="name" length="40"
not-null="true" />
</property>
</class>
</hibernate-mapping>
So, the property associated with column "name" will be mapped with the same
name.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira