cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Bug 140811 - Rev.Eng. wizard doesn't generate POJOs and HBMs
: Rev.Eng. wizard doesn't generate POJOs and HBMs
Status: RESOLVED INVALID
: javaee
Hibernate
: 6.5
: All All
: P2 with 1 vote (vote)
: 6.5
Assigned To:
:
:
:
:
: 147797
:
  Show dependency treegraph
 
Reported: 2008-07-18 19:58 by
Modified: 2009-09-22 10:36 (History)
Issue Type: DEFECT
:


Attachments
My Log File (426.85 KB, text/plain)
2008-09-22 19:33, scitronpousty
Details
my metrics file (4.43 KB, text/plain)
2008-09-22 19:36, scitronpousty
Details
My UI gestures (97.02 KB, text/plain)
2008-09-22 19:37, scitronpousty
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-07-18 19:58:34
I've tested reverse engineering wizard with sakila[1] sample database which we
can consider as a valid db schema. Only reveng file was create, no POJOs, no 
HBMs. 

[1] http://forge.mysql.com/wiki/SakilaSampleDB#Get_the_Sakila_Sample_Database
------- Comment #1 From 2008-07-18 20:04:59 -------
Hibernate Tools code from hibernate.org is not working well only with MySQL db.
This works well with JavaDB and HSQLDB.
Investigating why Hibernate Tools is failing for MySQL only..
------- Comment #2 From 2008-07-22 07:32:15 -------
Partial bug is fixed in http://hg.netbeans.org/main/rev/3f7a80c5548b.
------- Comment #3 From 2008-07-22 21:39:34 -------
With the above fix, POJOs (with or without annotations) can be generated. There
still seems to be a problem with
generating mapping files which I am investigating. Since there is a workaround
for this to use annotated POJOs, I am
lowering the priority to 3. 
------- Comment #4 From 2008-09-03 12:37:55 -------
*** Issue 145039 has been marked as a duplicate of this issue. ***
------- Comment #5 From 2008-09-17 23:16:27 -------
*** Issue 138839 has been marked as a duplicate of this issue. ***
------- Comment #6 From 2008-09-17 23:22:15 -------
This still doesn't work with PostgreSQL either using the nightly. 
I can't get it to work with annotations either. Can someone please tell me how
I can help diagnose where this is going
wrong. On my machine this feature is not doing anything but making the
reveng.xml file.
Extremely frustrating.


Product Version: NetBeans IDE Dev (Build 200809170201)
Java: 1.6.0_07; Java HotSpot(TM) Client VM 10.0-b23
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
------- Comment #7 From 2008-09-17 23:25:31 -------
Honza,
  Can you please try PostgreSQL and confirm that annotations can be generated
with Sakila.
thanks.
------- Comment #8 From 2008-09-18 22:12:05 -------
Fixed : http://hg.netbeans.org/main/rev/ee43236d7e7b
Now mapping files can be generated using Reverse Engg. wizard.
------- Comment #9 From 2008-09-18 22:12:53 -------
Also, Annotated POJOs can be generated without any issues as before.
------- Comment #10 From 2008-09-21 07:04:15 -------
Still not working for me. Here is the steps on followed on Win XP sp2, Java
6.latestButNot10, Netbeans9201401
Fresh .netbeans, .netbeans-derby and netbeansprojects folder
1. Add the db connection under server to my Postgresql database
2. Created a web project with only the hibernate libraries checked - used
tomcat 6.0.18 and the server and j2ee5
At this point I get a hibernate.cfg.xml in the root src folder
3. Added the jdbc jar file to the project libraries - using the jdbc4 driver
that ships with PostgreSQL. 
4. Right click on the source packages folder and select New -> Other and then
choose Hibernate -> HIbernate Mapping
Files and POJOS from database
5. Leave all the defaults on the first page of the wizard which will put the
reveng.xml file in src/java
6. I add all my tables on the next page of the wizard
7. Leave all the checkboxes alone and type in "data" for the packaged to create
the files in
It creates the reveng.xml file but none of the other files are created. 
This feels like broken to me. Please let me know if I am doing anything wrong
but it seems like I am following the right
path.
------- Comment #11 From 2008-09-21 07:11:51 -------
Just so you know this works if I point it at a derby datasource that came with
netbeans. 
So either this is an issue with usercreated datasources (on the server tab) or
with just postgresql
------- Comment #12 From 2008-09-21 08:05:56 -------
This also works with a MySQL user added database so my guess is this a
Postgresql issue. I have filed a bug 
http://www.netbeans.org/issues/show_bug.cgi?id=147797
for the hibernate plugin wizard where it does not add the postgresql dialect to
the hibernate.cfg.xml on creation.
Please test this with postgresql to make sure the fix works.
Thanks for all your help
------- Comment #13 From 2008-09-21 11:49:52 -------
Thanks Steve for testing the fix. Mostly the root cause is because of #147797
(not having the right dialect). I will
test the fix with Postgresql and verify. Meanwhile, if you have the IDE logs,
can you please attach to this issue ?

-Vadiraj
------- Comment #14 From 2008-09-22 16:46:15 -------
How do I turn on my IDE log? If it is on by default then where do I grab it?
Thanks
Steve
------- Comment #15 From 2008-09-22 19:25:32 -------
Hi Steven,
IDE log is stored in ${netbeans.home}/var/log/messages.log where
${netbeans.home} is the directory used by IDE to store data. You can find out
the exact 
value of '${netbeans.home}' on the About box in the IDE (Help/About). By
default, all development builds have the logs turned on.

-Vadiraj.
------- Comment #16 From 2008-09-22 19:33:38 -------
Created an attachment (id=70235) [details]
My Log File
------- Comment #17 From 2008-09-22 19:36:51 -------
Created an attachment (id=70236) [details]
my metrics file
------- Comment #18 From 2008-09-22 19:37:27 -------
Created an attachment (id=70237) [details]
My UI gestures
------- Comment #19 From 2008-09-24 09:54:06 -------
Fixed Schema selection related issue in generated reveng.xml file. Schema
generation now happens using <schema-selection> tags and not using <table-
filter> as it used to happen before. 
This fix applies to all databases including PostgreSQL with which this issue
was re-opened.
Tested with PostgreSQL, MySQL, Oracle 10g and JavaDB, the reverse engg. process
to generate annotated POJOs and/or mapping files.

http://hg.netbeans.org/main/rev/2bc40b634f50
------- Comment #20 From 2008-09-26 10:20:16 -------
Verified with NetBeans IDE Dev (Build 200809220201) (for MySQL and PostgreSQL,
JavaDB).
------- Comment #21 From 2008-09-26 10:21:50 -------
Sorry, verified with NetBeans IDE Dev (Build 200809251401) (for MySQL and
PostgreSQL, JavaDB).
------- Comment #22 From 2008-10-12 07:19:09 -------
Works now for me as well. Thanks everyone - loving netbeans, the developers,
and the community
------- Comment #23 From 2009-08-04 02:27:05 -------
When i creating a pojo and hbm from MySQL 5.1 database table (With foreign key
relationship) i am getting this.
------- Comment #24 From 2009-08-04 02:27:47 -------
When i creating a pojo and hbm from MySQL 5.1 database table (With foreign key
relationship) i am getting this.
------- Comment #25 From 2009-08-04 15:40:19 -------
I'm not very sure, what is the nature of your problem as your description is
too short but I tested generating POJOs and
HBMs nonetheless. Config:

Product Version: NetBeans IDE Dev (Build 090804)
Java: 1.6.0_0; OpenJDK Client VM 14.0-b08
System: Linux version 2.6.28-14-generic running on i386; UTF-8; en_US (nb)
Mysql:   Server version        5.1.31-1ubuntu2
sakila sample db

and everything seems to work fine (POJOs and HBMs were generated correctly).

=> INCOMPLETE If you encounter the problem again, please include more detailed
description of the problem, IDE log and
some steps to reproduce the problem.
------- Comment #26 From 2009-09-22 10:36:01 -------
Without requested information for long time - INVALID. We can't do anything in
this case. Reporter, please add requested information and reopen issue. 
Thanks in advance.