-->
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: many to many mapping problem
PostPosted: Thu Jul 29, 2010 11:09 am 
Newbie

Joined: Mon Jun 15, 2009 3:34 pm
Posts: 3
hi everyone,

in class "Yetki" I have below variable, namespace for both Yetki and Ekran class is "_02_CRM.Model"

"private IList<Ekran> yetkiEkran = new List<Ekran>();"

and the mappings I tried and the errors I got

[Bag(0, Name = "YetkiEkran", Table = "YetkiEkran", Cascade = CascadeStyle.None)]
[Key(1, Column = "YetkiID")]
[ManyToMany(2, Class = "Ekran", Column = "EkranId")]
public virtual IList<Ekran> YetkiEkran
{
get { return yetkiEkran; }
set { yetkiEkran = value; }
}
TestCase '_02_CRM.Test.TestDataFixture.Can_Init_Data_Without_Problems'
failed: System.TypeInitializationException : The type initializer for '_02_CRM.Persistence.NHibernateHelper' threw an exception.
----> System.Exception : Building SessionFactory failed
----> NHibernate.MappingException : unknown class Ekran
----> System.TypeLoadException : Could not load type Ekran. Possible cause: no assembly name specified.

[Bag(0, Name = "YetkiEkran", Table = "YetkiEkran", Cascade = CascadeStyle.None)]
[Key(1, Column = "YetkiID")]
[ManyToMany(2, Class = "Ekran, Model.Ekran", Column = "EkranId")]
public virtual IList<Ekran> YetkiEkran
{
get { return yetkiEkran; }
set { yetkiEkran = value; }
}

TestCase '_02_CRM.Test.TestDataFixture.Can_Init_Data_Without_Problems'
failed: System.TypeInitializationException : The type initializer for '_02_CRM.Persistence.NHibernateHelper' threw an exception.
----> System.Exception : Building SessionFactory failed
----> NHibernate.MappingException : unknown class Ekran, Model.Ekran
----> System.IO.FileNotFoundException : Could not load file or assembly 'Model.Ekran' or one of its dependencies. The system cannot find the file specified.

I did everything I think of, currently I cannot do many to many mapping for any class. My class definitions and namespaces are fine.

I am really annoyed right now any help will be great.


Top
 Profile  
 
 Post subject: Re: many to many mapping problem
PostPosted: Fri Jul 30, 2010 3:56 am 
Newbie

Joined: Thu Jul 29, 2010 3:47 am
Posts: 2
Quote:
----> NHibernate.MappingException : unknown class Ekran, Model.Ekran
----> System.IO.FileNotFoundException : Could not load file or assembly 'Model.Ekran' or one of its dependencies. The system cannot


Are you sure that corresponding file (Ekran.hbm.xml or how you it was named) is embedded to project?


Top
 Profile  
 
 Post subject: Re: many to many mapping problem
PostPosted: Sun Aug 01, 2010 4:45 pm 
Newbie

Joined: Mon Jun 15, 2009 3:34 pm
Posts: 3
hi,

solved by adding namespace and assembly manually. somehow it couldnt find them.

HbmSerializer.Default.HbmNamespace = "_02_CRM.Model";
HbmSerializer.Default.HbmAssembly = "02-CRM";

regards,


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.