- This topic has 18 replies, 3 voices, and was last updated 14 years, 11 months ago by Loyal Water.
-
AuthorPosts
-
mweidlichMemberHello all,
I know that there are a lot of similar threads to mine, but i couldn’t find an answer to my special case. It seems that Hibernate reverse engineering needs table names in lower case letters.
My table names are similar to “BiologicalProcess”, “ComplexComponent”, “DBUser”, etc.
and only if i change the table names to lower case (i.e. dbuser) reverse engineering seems to work. Is this a known issue or am I doing something wrong. Is there a way to customize reverse engineering for my scenario ?I suppose quotation marks are missing somewhere in the reveng script. Its
Select from <table>
instead of
Select from “<table>”
where <table> is a placeholder for the specific table name.Any ideas ?
Many thx in advanceMichael Weidlich
——————————–Here is my error log trying to reverse a DB Table “User”.
——————
eclipse.buildId=unknown
java.version=1.6.0_13
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Command-line arguments: -os win32 -ws win32 -arch x86 -cleanError
Tue Sep 22 18:20:38 CEST 2009
An internal error occurred during: “Generating Artifacts”.java.util.NoSuchElementException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796)
at java.util.HashMap$ValueIterator.next(HashMap.java:822)
at com.genuitec.eclipse.hibernate.tool.MESingleClassExporter.doStart(MESingleClassExporter.java:59)
at com.genuitec.eclipse.hibernate.tool.hbm2x.VAbstractExporter.start(VAbstractExporter.java:97)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$3.execute(GenerateArtifactsJob.java:552)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:64)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:95)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:417)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)————————–
I have installed:
My Eclipse Workbench: Build id: 7.5-20090609
mweidlichMemberI don’t know if it is important (tell me if you need something more)
Postgres Version 8.3.7
Driver jar: postgresql-8.4-701.jdbc4.jar
mweidlichMemberI’ve seen in other posts that you asked many times for installation details. Here they are:
—————————————
*** Date:
Mittwoch, 23. September 2009 11:06 Uhr MESZ** System properties:
OS=WindowsXP
OS version=5.1.0
Java version=1.6.0_13*** MyEclipse details:
MyEclipse Enterprise Workbench
Version: 7.5
Build id: 7.5-20090609*** Eclipse details:
MyEclipse Enterprise Workbench
Version: 7.5
Build id: 7.5-20090609Eclipse Plug-in Development Environment
Version: 3.4.2.R342_v20090122-7T7U1E9imVKz-A8Vz-p_jRS
Build id: M20080703-0800Eclipse Platform
Version: 3.4.2.R342_v20090122-9I96EiWElHi8lheoJKJIvhM3JfVsYbRrgVIWL
Build id: M20090211-1700Eclipse Graphical Editing Framework GEF
Version: 3.4.2.v20090218-1145-67728084A56B4I233613552
Build id: 200809101400Eclipse RCP
Version: 3.4.200.R342_v20090122-989JESTEbig-SVaL8UJHcYBr4A63
Build id: M20090211-1700Eclipse Java Development Tools
Version: 3.4.2.r342_v20081217-7o7tEAoEEDWEm5HTrKn-svO4BbDI
Build id: M20090211-1700Eclipse startup command=-os
win32
-ws
win32
-arch
x86
-showsplash
-launcher
C:\Programme\Genuitec\MyEclipse 7.5\myeclipse.exe
-name
Myeclipse
–launcher.library
C:\Programme\Genuitec\MyEclipse 7.5\../Common\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\eclipse_1115.dll
-startup
C:\Programme\Genuitec\MyEclipse 7.5\../Common\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar
-clean
-configuration
configuration
-vm
C:\Programme\Genuitec\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\bin\client\jvm.dll
support-shaliniMembermweidlich,
Can you do the following to narrow down the problem.
1) Are you getting the same problem with different tables in Postgre.
2) Are you getting the same problem with any table in other database(Oracle,mysql etc..)Here I am recommending you few workarounds for your issue.
1) Try to change your workspace.
2) Try to change your database.
Create a new database and copy(or create) your table from old database.
3) Can you confirm if you have jboss’s hibernate tools plugin? If so, remove the plugin and do Reverse Engineering again.I hope this works for you.
mweidlichMemberTo 1) Yes i always get the problem for tables with capital letters, no matter which one it is. (i tried many of them)
To 2) At this point i don’t have any other databases running (but i will implement mysql for testing purpose)I’ll try your recommendations and report back to you. Thx so far!
mweidlichMemberTo 2) Actually I don’t get the same problem on MySQL : I created a table “User” with 4 columns “db_id”, “Name”, “Password”, “Description” and reverse engineering worked. It generated 3 class Files as it should:
AbstractUser.java
User.java
UserDAO.javaBut due to business reasons i can’t export my whole database structure to mysql (what you might suggest) i will have to find a solution for Postgres.
1) I exported a table into another database and the problem persists. Tables with capital letters can’t be reversed (due to the above exception) No files are generated.
Still to Try:
2) I will try to change my workspace now and retry the procedure
3) As far as i know i dont have Jboss’s hibernate tools plugin integrated in Myeclipse. Though i am pretty sure i downloaded it once and integrated it into “Eclipse”. I am not using Eclipse anymore, as Myeclipse provides much more functionality for me ! Does my Eclipse installation interfere with Myeclipse ? Are you talking about removing Eclipse with the potential JBoss Plugin ?
mweidlichMemberOkay to summarize:
————————–
On PostgreSQL
1) I changed my workspace and i still get the same error
2) I changed the database creating a similar table and i still get the same error
3) Reverse Engineering Table “User” does not work, table “user” does work.
*) If a lower case table was successfully reversed in a project and afterwards i try to reverse another upper case table i don’t get an error but the classes are not generated either. It seems to skip the error message somehow. If I delete all reversed files in the package than i get the error again. (An internal error occurred during: “Generating Artifacts”.)4) Reverse Engineering from a MySQL database table seems to work with upper case letters. But i really need to get it working with Postgresql 8.3.7.
——————————–
My approach :
1) Make New Web Project
2) Add Hibernate Capabilities
3) Hibernate Reverse Engineer the TableDo you need some screenshots to replicate the problem ?
support-shaliniMembermweidlich,
I have raised a PR with the dev team.
Thank you for bringing this up
mweidlichMemberDear shalini,
is there any new insight on the matter ?
Yours Michael
Loyal WaterMemberMichael,
The dev team has been unable to reproduce this issue at their end. They have tried this with PostGRES 8.4. I there any additional information that you could give us that might help us reproduce this? The screenshots would be helpful.
mweidlichMemberI will try the following
I will see if i get the same error on an older version of postgres (8.1.1), which is installed on another server in our infrastructure. If it doesn’t happen. It should be either the database version or the configuration file. Maybe you have an idea, which might be the relevant settings ? Something like ‘put tablenames in quotes’ maybe. I am not sure. I am no expert in this area.
If this doesn’t work out, i will send you a database generation file (*.sql) with my tables and my webapplication as a *.war together with some screenshots describing in detail my problem.
I will get back to you soon. Thx for your support! By all means I will let you know !
Thx again
Michael
mweidlichMemberThis message has not been recovered.
Loyal WaterMemberThis message has not been recovered.
mweidlichMemberThis message has not been recovered.
Loyal WaterMemberThis message has not been recovered.
-
AuthorPosts