This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 178556 - Wrong Generation of Hibernate Files
Summary: Wrong Generation of Hibernate Files
Status: RESOLVED INVALID
Alias: None
Product: javaee
Classification: Unclassified
Component: Hibernate (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-14 00:38 UTC by alanluayon
Modified: 2014-07-17 12:23 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
PosgreSQL db (84.21 KB, image/png)
2009-12-14 00:38 UTC, alanluayon
Details
Hibernate POJO (116.71 KB, image/png)
2009-12-14 00:39 UTC, alanluayon
Details
Messages.log (170.88 KB, text/plain)
2009-12-14 00:41 UTC, alanluayon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alanluayon 2009-12-14 00:38:48 UTC
Created attachment 92491 [details]
PosgreSQL db

DB: PostgreSQL 8.4
IDE: Netbeans 6.8
JDK: Java 6 update 16

Steps
1. New Project Maven
2. Tapestry 5.1.0.5 Archetype
3. Click <Your> Project ->Properties->Add framework->Hibernate 3.2.5->Select Database Connection.
4. Project->Other Sources->Default Package->Hibernate Reverse Engineering Wizard
5. Add tb_news then finish.
6. Source Packages->New Package (ex. com.hb)
7. Select com.hb->New Hibernate Mapping Files & PJOs from Database.
8. Error Extra Generation of Code.
Comment 1 alanluayon 2009-12-14 00:39:44 UTC
Created attachment 92492 [details]
Hibernate POJO

This is the generated error in the POJO file.
Comment 2 alanluayon 2009-12-14 00:41:32 UTC
Created attachment 92493 [details]
Messages.log

Messages.log
Comment 3 alanluayon 2011-03-16 22:25:40 UTC
This bug will occur when there is a foreign key between two tables.
Comment 4 Sergey Petrov 2011-03-17 07:22:02 UTC
Where to find "Tapestry 5.1.0.5 Archetype"? What project type?
Comment 5 alanluayon 2011-03-17 07:45:57 UTC
Just create a simple any hibernate application then in postgresql create a two table with a foreign key. Then use hibernate wizard to create its POJO. Then the generated files are not correct.
Comment 6 Sergey Petrov 2014-07-17 12:23:42 UTC
I've realized it's unclear what is wrong with marked by red constructor, what is wrong?
"8. Error Extra Generation of Code."?
In this case, you can see two constructors, one contain only "required" fields and another one all fields, I fI got it right.
Please reopen if I miss smth.