-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: NullPointerException when reverse engineering
PostPosted: Mon Dec 14, 2009 3:37 pm 
Newbie

Joined: Mon Jan 12, 2009 4:38 pm
Posts: 19
This error appears when reverse engineering (trying to generate Java5 EJB3 code) a mysql database:
java.lang.NullPointerException
at org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:77)
at org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:73)
at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1263)
at org.hibernate.cfg.JDBCMetaDataConfiguration.secondPassCompileForeignKeys(JDBCMetaDataConfiguration.java:33)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1170)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate$2.execute(CodeGenerationLaunchDelegate.java:318)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:64)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:94)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.buildConfiguration(CodeGenerationLaunchDelegate.java:285)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.runExporters(CodeGenerationLaunchDelegate.java:218)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.launch(CodeGenerationLaunchDelegate.java:138)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:866)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1069)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

You will find herebelow the sql schema, to import into a mysql 5.0 database. I used mysql --default-character-set=utf8 to import it.

The error does not happen if the last line of the schema (adding a foreign key) is removed.

Using eclipse Platform Version: 3.5.1 Build id: M20090917-0800 on debian etch, Hibernate Tools 3.2.4.v200909151014R-H192-GA.

Thanks for any help.

----
DROP TABLE IF EXISTS Catégorie;
CREATE TABLE Catégorie
(
ID Int8
);

DROP TABLE IF EXISTS Transaction;
CREATE TABLE Transaction
(
Compte_positif Int8
);
alter table Catégorie ADD INDEX(ID);
alter table Transaction add constraint youpee foreign key (Compte_positif) references Catégorie(ID);

_________________
Olivier


Top
 Profile  
 
 Post subject: Re: NullPointerException when reverse engineering
PostPosted: Mon Dec 14, 2009 4:48 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
report in jira please

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: NullPointerException when reverse engineering
PostPosted: Mon Dec 14, 2009 5:01 pm 
Newbie

Joined: Mon Jan 12, 2009 4:38 pm
Posts: 19
Done. https://jira.jboss.org/jira/browse/JBIDE-5461

_________________
Olivier


Top
 Profile  
 
 Post subject: Re: NullPointerException when reverse engineering
PostPosted: Mon Jan 31, 2011 2:53 pm 
Newbie

Joined: Mon Jan 31, 2011 2:49 pm
Posts: 3
I am a newbie on hibernate. Could someone tell me whether the patch is incorporated in the official release? I have the hibernate-3.6.0 final distribution from sourceforge and it doesn't seem to contain the patch. I would like to know how to get the official patch for this bug.


Top
 Profile  
 
 Post subject: Re: NullPointerException when reverse engineering
PostPosted: Wed Mar 02, 2011 5:39 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
No, they didn't upply the patch.
Actually the class was not changes since hibernate 3.2


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.