Skip to content
This repository has been archived by the owner on Oct 8, 2020. It is now read-only.

Microsoft.SqlServer.Types.HierarchyId mapping support for NHibernate

Notifications You must be signed in to change notification settings

roydukkey/NHiberntate.HierarchyId.UserType

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NHiberntate HierarchyId UserType v1.0.0

Download Solution | Assembly

Mapping

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="DataLayer" namespace="NHibernate.Map">
	<class name="NHibernate.Map.OrganizationUnit, DataLayer" table="`orgunit`">

		<property name="HierarchyId" column="`ou_hid`" type="NHibernate.HierarchyId.UserType, NHibernate.HierarchyId.UserType" />
		...

	</class>
</hibernate-mapping>

Object with SqlHierarchyId

namespace NHibernate.Map
{
	using Microsoft.SqlServer.Types;

	public class OrganizationUnit
	{
		#region Fields

		private SqlHierarchyId _hierarchyId;
		...

		#endregion Fields

		#region Properties

		public virtual SqlHierarchyId HierarchyId
		{
			get { return _hierarchyId; }
			set { _hierarchyId = value; }
		}
		...

		#endregion Properties
	}
}

About

Microsoft.SqlServer.Types.HierarchyId mapping support for NHibernate

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages