Where should I put NHibernate hibernate xml files?

I am trying to install nhibernate according to this tutorial, but it does not say where I should put the Cat.hbm.xml file and how the project should understand its part of the project.

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="QuickStart" assembly="QuickStart">
<class name="Cat" table="Cat">
<!-- A 32 hex character is our surrogate key. It automatically
generated by NHibernate with the UUID pattern. -->
<id name="Id">
<column name="CatId" sql-type="char(32)" not-null="true"/>
<generator class="uuid.hex" />
</id>
<!-- A cat has to have a name, but it shouldn' be too long. -->
<property name="Name">
<column name="Name" length="16" not-null="true" />
</property>
<property name="Sex" />
<property name="Weight" />
</class>
</hibernate-mapping>

https://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/pdf/nhibernate_reference.pdf

+3
source share
2 answers

Create the Resources or Mapping folder in the project. Place the entire mapping file in this folder and save them in assemblies, adding them to the project as "Build Action = Embedded Resource"

+8
source

, Stephen Bohlen " NHibernate" Autumn of Agile Series, nhibernate.

0

Source: https://habr.com/ru/post/1723965/


All Articles