-->
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: Some newbie questions
PostPosted: Tue May 17, 2005 2:26 pm 
Ok, i'm starting to use NHibernate with ASP.NET... im really new with the .NET Framework so i got a few questions....

Where do i put the NHibernate config files?

Should I put the *.hbm.xml files into the DLL as resource files? If not where should they be located?

Guess that's all...

Thanks in advance


Top
  
 
 Post subject:
PostPosted: Tue May 17, 2005 8:54 pm 
Newbie

Joined: Fri May 13, 2005 1:59 pm
Posts: 11
I think it's easiest to compile them as embedded resources. Then you can use the AddAssembly method to add all of your mappings at once without having a set of code you need to update every time you need to add a new mapping. I'd also recommend adding NHibernate to your solution (assuming you're using Visual Studio) so that you can add a project reference to your other assemblies and you'll be able to step into your NHibernate calls.


Top
 Profile  
 
 Post subject: Re: Some newbie questions
PostPosted: Tue May 17, 2005 11:40 pm 
Victor wrote:
Ok, i'm starting to use NHibernate with ASP.NET... im really new with the .NET Framework so i got a few questions....

Where do i put the NHibernate config files?

Should I put the *.hbm.xml files into the DLL as resource files? If not where should they be located?

Guess that's all...

Thanks in advance


NHibernate configs should be added inside your Web.config file. You can also add config settings to your code.

As lamb.jim said ... add your *.hbm.xml file to your .net solution as embedded resources. It be best to put those *.hbm.xml files in the same directory as the related *.cs classes containing the definition of the persistent objects.


Top
  
 
 Post subject:
PostPosted: Wed May 18, 2005 8:40 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
And a nice trick (if you use VS.NET) is to edit your project and hide hmb.xml files behind cs files
Example wrote:
<File
RelPath = "MyEntity.hbm.xml"
DependentUpon = "MyEntity.cs"
BuildAction = "EmbeddedResource"
/>

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 20, 2005 6:50 am 
Newbie

Joined: Fri May 20, 2005 5:35 am
Posts: 1
To KPixel:
You said "And a nice trick (if you use VS.NET) is to edit your project and hide hmb.xml files behind cs files".I tried,but I Failed. :(
I use VS.NET 2003,I Edit myProject.csproj by Ultraedit just like you say,but It seams not effect.Why?
Thanks in advance
(I am a chinese,My English is new. :oops: )


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 20, 2005 11:56 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
sky wrote:
I use VS.NET 2003, I edit myProject.csproj by Ultraedit just like you say,but It seams not effect. Why?


You mean that after this change, the hbm.xml is not hide behind its cs file ?
If it is that, then you have probably made a mistake somewhere...
(post the part of your csproj you edit)

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


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.