-->
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.  [ 4 posts ] 
Author Message
 Post subject: Mapping file not found (yet another...)
PostPosted: Tue Oct 31, 2006 4:47 am 
Newbie

Joined: Thu Oct 19, 2006 10:11 am
Posts: 5
Hibernate version:
1.2.0beta1

Mapping documents:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
 


  <class name="nHibernate.Stop, nHibernate" table="STOP" lazy="false">

    <id name="stopId" column="STOPID" type="int">
      <generator class="native" />
    </id>

    <property name="stopName" column="STOPNAME" type="String" length="400"/>
    <property name="shortName" column="SHORTNAME" type="String" length="160"/>
    <property name="secLangId" column="SECONDLANGUAGEID" type="int"/>

  </class>

</hibernate-mapping>




Name and version of the database you are using:
Firebird 1.5.x



Ok, trouble, trouble, trouble...


I have had a very hard time to get this nHibernate to work, and it seems like it never will!

(se previous post
here
... posting a link to that problem since it could be related)

Now, the mapping file is not found and, yes, there are many, many, post about this but there seems to be only one solution. To compile the mapping file as a embedded resource file. But I use Visual Studio 2005 (.net 2.0) and since I am fairly new to it, I can't find that option where everyone says it should be!
This is beginning to be frustrating!


please... =(







[/code]


Top
 Profile  
 
 Post subject: Re: Mapping file not found (yet another...)
PostPosted: Tue Oct 31, 2006 5:20 am 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
mackey wrote:
Now, the mapping file is not found and, yes, there are many, many, post about this but there seems to be only one solution. To compile the mapping file as a embedded resource file. But I use Visual Studio 2005 (.net 2.0) and since I am fairly new to it, I can't find that option where everyone says it should be!


If It is normal VS 2005 web project, then then it is kind of messy... It uses special directories for stuff, like Global_Resources and so on. But I'm not sure if adding file to that directory causes it to be embedded.

Another thing is that in web project the path of assembly might not be the one You except. The assemblies are shadow-copied into temporary location. So, if You load from directpry, better get the ühysical location of request URL and use it. (there is MapPath method to do such mapping... in several classes, including HttpServerUtility, Page and so on)

Another option would be to create a ordinar library assembly for persistent classes and use embedded resources.

Or use Web Application Project http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx, and include mappins as embedded resources.

Gert

_________________
If a reply helps You, rate it!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 6:04 am 
Newbie

Joined: Thu Oct 19, 2006 10:11 am
Posts: 5
hmmm... well it's not a WebApplicaton, but a clr:pure Visual C++ assembly...

I'll try do it as you recommend and create a separate assembly for my persistent classes...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 7:53 am 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
mackey wrote:
hmmm... well it's not a WebApplicaton, but a clr:pure Visual C++ assembly...

I'll try do it as you recommend and create a separate assembly for my persistent classes...

Ouch: turns out that the resource adding to c++ project is not for newbies :O

Maybe ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vssoln/html/8f1e2435-69fd-4261-aad3-894b31afaf42.htm (or http://msdn2.microsoft.com/en-us/library/e2c9s1d7.aspx) gives some glue...

Gert

_________________
If a reply helps You, rate it!


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