-->
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.  [ 6 posts ] 
Author Message
 Post subject: MappingException (unmapped class); eclipse plugin alpha 1
PostPosted: Thu Feb 10, 2005 1:19 pm 
Newbie

Joined: Thu Nov 18, 2004 6:01 pm
Posts: 17
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
version 3.0, beta 3
eclipse tools version:
3.0, alpha 1
Mapping documents:
eclipse tool generated hibernate.cfg.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.username">sa</property>
        <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
        <property name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost/t1db</property>
        <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>

    </session-factory>
</hibernate-configuration>


No other mapping files are generated or input.
Code between sessionFactory.openSession() and session.close():
n/a
Full stack trace of any exception that occurs:
Code:
org.hibernate.MappingException: Association references unmapped class: GenerateMap
   at org.hibernate.cfg.JDBCBinder.bindCollectionSecondPass(JDBCBinder.java:1178)
   at org.hibernate.cfg.JDBCBinder$CollectionSecondPass.secondPass(JDBCBinder.java:1201)
   at org.hibernate.cfg.HbmBinder$SecondPass.doSecondPass(HbmBinder.java:2052)
   at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:830)
   at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:801)
   at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$3.execute(ArtifactGeneratorWizard.java:218)
   at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:76)
   at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:210)
   at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.doFinish(ArtifactGeneratorWizard.java:147)
   at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.access$0(ArtifactGeneratorWizard.java:127)
   at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$1.run(ArtifactGeneratorWizard.java:95)
   at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:105)

Name and version of the database you are using:
hsqldb 1.7.2
oracle 9.2 using oracle jdbc driver 10.1
The generated SQL (show_sql=true):
n/a
Debug level Hibernate log excerpt:
How can I turn on debug level log for eclipse plugin?



I'm following the steps outlined in the tools' introduction web page: http://www.hibernate.org/hib_docs/tools/. I successfully created the hibernate.cfg.xml, and the hibernate console. Then I try to 'reverse engineer'. I select destination directory, "Reverse engineer from JDBC connection", "Generate domain code" and "Generate mappings".


I don't know if this exception is expected behavior. I'm expecting the tool to generate all mappings and not complain that one does not exist.

I this is expected behavior, what am I expected to do at this point: hand code the mapping to the class (that doesn't exist yet either)?



I am able to view the table schema using squirrel. The exception indicates that the schema can be read (otherwise, the tool would not have known about the foreign key association - right?)

I run this in a fresh install of eclipse 3.1M4 w/ eclipse tools and jboss plugin 1.4.1, and with a brand-new workspace.

Here is schema reduced to two tables with minimal columns:

Code:

CREATE TABLE "PRICE_CHANGE" (
       "PC_ID"          VARCHAR(20) NOT NULL,
       "PC_STATE"           VARCHAR(20) NULL,
       "ACTION"             VARCHAR(20) NULL,
       CONSTRAINT "SYS_C004194"
              PRIMARY KEY ("PC_ID")
);
CREATE TABLE "GENERATE_MAP" (
       "PC_GEN_ID"          VARCHAR(20) NULL,
       "GEN_DATE"           DATE NULL,
       "LCR_PC_ID"          VARCHAR(20) NULL,
       CONSTRAINT R_31
              FOREIGN KEY ("PC_ID")
                             REFERENCES "PRICE_CHANGE"
);


I apologize if this already appears on this or other hibernate forum. I spent about 30 minutes searching and didn't find this specific problem described. I you know of a topic, could you provide link? or a successful search that would lead me to it? Thanks.


John


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 10, 2005 2:20 pm 
Newbie

Joined: Thu Nov 18, 2004 6:01 pm
Posts: 17
Sorry, I just noticed a typo in one of the schemas. Here is correction.

Code:

CREATE TABLE "GENERATE_MAP" (
       "PC_GEN_ID"          VARCHAR(20) NULL,
       "GEN_DATE"           DATE NULL,
       "PC_ID"          VARCHAR(20) NULL,
       CONSTRAINT R_31
              FOREIGN KEY ("PC_ID")
                             REFERENCES "PRICE_CHANGE"
);



Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 11, 2005 5:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmmm..please submit this as a bug to JIRA.

together with a full DDL script.

thank you

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 11, 2005 11:41 am 
Newbie

Joined: Thu Nov 18, 2004 6:01 pm
Posts: 17
Thanks for responding.

The JIRA issue key is: HHH-137

John


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 7:42 pm 
Newbie

Joined: Fri Jan 07, 2005 5:46 pm
Posts: 19
I'm running into the same problem with MS SQL on the following table:

CREATE TABLE [test_sample_type] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[test_id] [int] NULL ,
[sample_type_id] [int] NULL ,
CONSTRAINT [fk_TestSampleType_testId] FOREIGN KEY
(
[test_id]
) REFERENCES [test] (
[id]
)
)

CREATE TABLE [test] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
...
)

As a workaround: Can I exclude tables from the RE process? Is this documented somewhere (I haven't found it)?

Is there a date for 3.0alpha 2 release yet (even if approximately)?

Should I add this case to JIRA?

Thanks,

Andreas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2005 2:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
exclusions not availble in ui now, but it has always been in code (JDBCFilter)

next release is due soon for which i hope to fix this bug.

yes please post the schema that fails to the jira (on the already existing issue if possible) as it look different.

-max

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.