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

Summary: Wrong Generation of Hibernate Files
Product: javaee Reporter: alanluayon <alanluayon>
Component: HibernateAssignee: Sergey Petrov <sj-nb>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: PosgreSQL db
Hibernate POJO
Messages.log

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.