Hello,
I’m having some serious problems with the Hibernate reverse engineering process. I’ve tried the process with PostgreSQL and Mysql and both result in the same error.
I defined a DB in the EA then proceeded to its code generation. I have no problem using the script to create the DB in either the Database systems.
But when I try to generate the code with reverse engineer I get the same error code:
org.hibernate.MappingException: An association from the table restriction refers to an unmapped class: TargetReportingdata
Hibernate version: 3.2.0GA
Mapping documents: The tables i am having problems with are:
CREATE TABLE target_reportingdata
(
targetdef_id INTEGER NOT NULL,
reportingdatadef_id INTEGER NOT NULL,
PRIMARY KEY (targetdef_id, reportingdatadef_id),
KEY (reportingdatadef_id),
KEY (targetdef_id)
)
;
and
CREATE TABLE restriction
(
id INTEGER NOT NULL,
targetdef_id INTEGER NOT NULL,
reportingdatadef_id INTEGER NOT NULL,
restrictiontype_id INTEGER NOT NULL,
restriction_value INTEGER NOT NULL,
description VARCHAR(100),
eventdef_id INTEGER NOT NULL,
PRIMARY KEY (id),
KEY (eventdef_id),
KEY (restrictiontype_id),
KEY (targetdef_id, reportingdatadef_id)
)
;
ALTER TABLE restriction ADD CONSTRAINT FK_restriction_target_reportingdata
FOREIGN KEY (targetdef_id, reportingdatadef_id) REFERENCES target_reportingdata (targetdef_id, reportingdatadef_id)
;
Full stack trace of any exception that occurs: org.hibernate.MappingException: An association from the table restriction refers to an unmapped class: TargetReportingdata
at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1252)
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:322)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:88)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.buildConfiguration(CodeGenerationLaunchDelegate.java:288)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.runExporters(CodeGenerationLaunchDelegate.java:219)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.launch(CodeGenerationLaunchDelegate.java:134)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:766)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:608)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:899)
at org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlugin.java:1102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Name and version of the database you are using: PostgreSQL 8.2 and Mysql 5.0
Thanks in advance for a reply,
Hspoupas
|