[
http://opensource.atlassian.com/projects/hibernate/browse/HBX-751?page=all ]
Max Rydahl Andersen updated HBX-751:
------------------------------------
Component: (was: middlegenplugin)
i assume this is for the reverse engineering features of Hibernate Tools and not
Middlegen, right ?
problems with db-objects named "abc$ta_tab"
-------------------------------------------
Key: HBX-751
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-751
Project: Hibernate Tools
Type: Bug
Components: hbm2java
Versions: 3.2beta7
Environment: SuSE Linux Enterprise Server 9
Hibernate 3.1.3
Hibernate Tools 3.2 beta 7
Oracle 9.2.0.6
Reporter: Ronny Riedel
Problem
-------
I have e.g. 2 tables in my oracle-db: "PDC$TA_ITEM" and
"PDC$TA_STATUS", with a foreign key references from "PDC$TA_ITEM" to
"PDC$TA_STATUS". In my build.xml-File, I specified
<jdbcconfiguration packagename="com.foo.bar" />
The with hbm2hbmxml generated hbm.xml-Files named "pdc$taItem.hbm.xml" and
"pdc$taStatus.hbm.xml". Because of the reference, the file
"pdc$taItem.hbm.xml" contains amongst others following code:
<many-to-one name="taStatus" class="com.foo.bar.pdc.taStatus">
<column name="STATUS_ID" />
</many-to-one>
Because i have a little bit notion of hbm.xml-files, i recognized, that
com.foo.bar.pdc.taStatus are wrong. So I changed it to com.foo.bar.pdc$taStatus by hand,
the spelling I know from middlegen for hibernate and run hbm2java. The ant-task generated
all java-classes without errors. But when i opened the java-files with eclipse, I noticed
that hbm2java genereted the following code in "taItem":
import com.foo.bar.pdc.taStatus;
When I change these to "import com.foo.bar.taStatus;, everything was fine in
eclipse. But til now I had no opportunity presented itself for real-testing the generated
javacode.
Summary
-------
In my mind as long as the names of the db-tables are valid JavaNames, they shouldn't
be changed. If the names aren't valid JavaNames, throw an error while reverse
engineering like "object name xyz is not a valid javaname. you have to specify a
valid javaname in the hibernate.reveng.xml-file for these object."
--
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