The most convenient method to add NHibernate and SQLite for C# project is using NuGet. You can check that in [1]. But I prefer a more free way to do it with NAnt. Let's do it. Step 1, download all packages from official websites. Step 2, set up the d…
Unable to locate persister for the entity named 'Model.Customer'.The persister define the persistence strategy for an entity.Possible causes: - The mapping for 'Model.Customer' was not added to the NHibernate configuration. 第一 xml文件必须为 *.hbm.xml 第二 …
Welcome to NHibernate If you're reading this, we assume that you've just downloaded NHibernate and want to get started using it. This tutorial will talk you through the following: Installing NHibernate Defining a simple business object class. Create…
SessionManager using System; using System.IO; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using System.Web; using NHibernate; using NHibernate.Cfg; using NHibernate.Context; namespace Northwind.Repositori…
持久化类是一个应用程序中的类,主要用来实现业务逻辑(例如,在电商应用中的客户和订单类).持久化类,就像它的名字一样,生命周期短暂并且用来持久化的据库对象实例. 如果这些类的构造能够依照一些简单的原则,比如说Plain Old CLR Object (POCO)编程模型,NHibernate能够工作得最好. 一个简单的POCO例子 大多数的.NET应用程序需要一个持久化类来表示猫科动物. using System; using System.Collections.Generic; namespa…
最近利用NHibernate映射类型为Clob字段在插入数据时发现当字符的字节数(一个半角字符一个字节,一个全角字符两个字节)在2000-4000之间时报错(ORA-01461:仅可以插入LONG列的LONG值赋值).经过不断查找资料和自己的试验该问题终于得到解决,下边我将自己的心得给大家做一个分享. 准备 系统环境 xp+.net2.0+oracle9i 表结构(由于是测试,表结构随便建了一张) XX 字段名 类型 ID VARCHAR2(70) TEST CLOB 测试 方式1:直…
Build 4.0.0.Alpha1 ============================= ** Known BREAKING CHANGES from NH3.3.3.GA to 4.0.0 NHibernate now targets .Net 4.0. Many uses of set types from Iesi.Collections have now been changed to use corresponding types from the BC…
参考:http://www.cnblogs.com/renrenqq/archive/2006/08/04/467688.html 但这个方法还不能解决Session缓存问题,由于创建Session需要消耗大量的内存,参考上面的方法,当请求并发的时候,内存不断的增加. 在网上找了很多种方法都没有解决.下面贴上主要代码: 1.接口请参考上面文章 using NHibernate; using System; using System.Collections.Generic; using Syste…
NHibernate常见问题及解决方法 曾经学过NHibernate的,但是自从工作到现在快一年了却从未用到过,近来要巩固一下却发现忘记了许多,一个"in expected: <end-of-text> (possibly an invalid or unmapped class name was used in the query)."错误查了好半天终于查到了.这篇文章是我转载的NHibernate的常见错误... hbm.xmlNHibernate文件中版本号可能引起的…
首个基于NHibernate的应用程序 Your first NHibernate based application 英文原文地址:http://www.nhforge.org/wikis/howtonh/your-first-nhibernate-based-application.aspx 翻译原文地址:http://www.cnblogs.com/13yan/p/5671072.html 本文涉及到的DEMO下载 定义领域模型 让我们开始通过定义一个非常简单的领域模型.目前它是由一…