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.  [ 3 posts ] 
Author Message
 Post subject: unmapped class: Int32
PostPosted: Mon Jun 30, 2008 11:14 am 
Newbie

Joined: Tue May 13, 2008 5:57 am
Posts: 2
I'm really stumped by this one. It's unable to map to the Int32 class, which I'd've thought was be built in.

It didn't really break after I changed much, save for implementing an additional class which I removed, and re-added but alas to no avail.

Before you ask, this is set to an embedded resource, and I have tested it in isolation to eliminate problems, and tried JournalID as an Int64 and Int32.


nHibernate version: 1.2

Mapping documents:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="SpongeLibrary.JournalEntry, SpongeLibrary" table="Journal">
<id name="JournalID" type="Int64" unsaved-value="0">
<generator class="native" />
</id>
<many-to-one name="ProjectID" not-null="true"/>
<property name="StartDate" type="DateTime"/>
<property name="EndDate" type="DateTime"/>
<property name="EntryEmployee" type="Int32"/>
<property name="AssignedEmployee" type="Int32"/>
<property name="EntryType" type="SpongeLibrary.EntryTypes, SpongeLibrary"/>
<property name="DateSemantics" type="SpongeLibrary.DateSemanticsOptions, SpongeLibrary"/>
<property name="Status" type="Int32"/>
<property name="Comment" type="String" length="8000"/>
<property name="Historical" type="Boolean"/>

<joined-subclass name="SpongeLibrary.InvoiceEntry, SpongeLibrary" table="JournalInvoice">
<key column="JournalID" />
<property name="InvoiceCode" type="String" length="20"/>
</joined-subclass>
</class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close(): Don't think it gets that far.

Full stack trace of any exception that occurs:

eClasses::BindToConfiguration - BuildSessionFactory: NHibernate.MappingException: An association from the table Journal refers to an unmapped class: Int32
at NHibernate.Cfg.Configuration.LogAndThrow(MappingException me)
at NHibernate.Cfg.Configuration.SecondPassCompileForeignKeys(Table table, ISet done)
at NHibernate.Cfg.Configuration.SecondPassCompile()
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at Database_Manager.eClasses.BindToConfiguraA first chance exception of type 'NHibernate.MappingException' occurred in NHibernate.dll


Name and version of the database you are using: SQL Server Compact Edition 3.5

The generated SQL (show_sql=true): N/A

Debug level Hibernate log excerpt:

0 [9] INFO NHibernate.Cfg.Configuration (null) - checking mappings queue
10062 [9] INFO NHibernate.Cfg.Configuration (null) - processing one-to-many association mappings
10062 [9] INFO NHibernate.Cfg.Configuration (null) - processing one-to-one association property references
10062 [9] INFO NHibernate.Cfg.Configuration (null) - processing foreign key constraints
10062 [9] DEBUG NHibernate.Cfg.Configuration (null) - resolving reference to class: JournalEntry
10063 [9] DEBUG NHibernate.Cfg.Configuration (null) - resolving reference to class: Int32
10064 [9] ERROR NHibernate.Cfg.Configuration (null) - An association from the table Journal refers to an unmapped class: Int32


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 01, 2008 5:41 pm 
Beginner
Beginner

Joined: Fri May 30, 2008 3:57 pm
Posts: 26
I'm new to NHibernate so this may be a silly suggestions, but have you verified that you have a reference to System?

If not that, I have no idea so I'll step out of the way and let the more experienced folks have at it :)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 02, 2008 2:19 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
What's the type of ProjectID in your class ?

<many-to-one name="ProjectID" not-null="true"/>

Is it possible that it's Int32 ? If thta's the case, a many-to-one expects a entity, not a id. Change that to the entity.

If that's not the case, post the classes and the table definitions.

_________________
--Wolfgang


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