nhibernate

Is there a way of using NHibernate without connection to DB?

I need that Nhibernate only generate pure SQL, which i will send to my c functions. ...

Using ASP.NET Caching on top of NHibernate 2nd Level Caching

Should i consider using ASP.NET Caching to cache query results on top of NHibernate 2nd Level Caching to improve performances ? ...

Override for fluent NHibernate for long text strings nvarchar(MAX) not nvarchar(255)

When ever you set a string value in fluent NHibernate it alwasy sets the DB vales to Nvarchar(255), I need to store quite a lot of long string which are based on user inputs and 255 is impractical. Just to add this is an issue with the automapper as I am using fluent NHibernate to build the database. ...

How to connect oracle database remotely from a ASP.Net application

I have two PC. In one pc(PC1) i have installed oracle express edition 10g (10.2.0.0 as far as i know). And in another(PC2) i have installed visual studio 2008 sp1. In PC2 the ASP.Net application is running. But i can not connect to the oracle database to PC1. PC1 and PC2 are connected by LAN(TCP/IP {Actually they are ...

How do I use the IHasManyConvention Fluent NHibernate convention to set the PropertyRef on a HasMany mapping?

Currently I'm using Fluent NHibernate to generate my database schema, but I want the entities in a HasMany relationship to point to a different column for the reference. IE, this is what NHibernate will generate in the creation DDL: alter table `Pony` add index (Stable_ID), add constraint Ponies_Stable foreign key (Stable_Id) references...

ArgumentOutOfRangeException using ToString in LINQ to NHibernate query

I have a basic NHibernate.Linq query: var items = from item in session.Linq<ObjectType>() where item.ID > 0 select new { ID = item.ID, Type = item.ClassName }; This works fine. However, ObjectType is a heavy-weight class, and I only want ID and ClassName. So I've created a DTO called EntityInfo: public cla...

Basic Fluent NHibernate program compiles and runs, but nothing is saved to or loaded from database

I am trying a very simple Fluent Nhibernate example: SQL 2005 database with one table, VS2008 console application. The table has one record before the program starts. I am trying to add one record, then display all records from table. Programs successfully compiles and runs without any exceptions, however no records are displayed. HBM m...

Is there any consideration while comparing Enums in LINQ-to-NHibernate or LINQ?

In such a query: var q = from l in session.Linq<Letter>() where letterTypeSearch == null ? true : (l.LetterType.ToString() == letterTypeSearch) l.LetterType is an Enum. UPDATE It seems that's impossible to compare Enums in current linq-to-nhibernate. While letterTypeSearch is a string containing a LetterType instance...

Using LinqToLucene With NHibernate and NHibernate.Search

Does anyone already use LinqToLucene with NHibernate.Search? How to getting started ? Thanks. ...

NHibernate Insert Ignore

Hello, I need use Insert Ignore for my table, which have Unique index on several fields. How can i do it? Thank you ...

NHibernate and Windsor assembly conflicts

Hi, I am having an issue getting Hibernate and Windsor to work together. My setup details are as follows I have two projects -DomainModel -MVCApp I have downloaded NHibernate 2.1.2 and Windsor 2.1.1 I added the following references to DomainModel from the required_Bins folder of the NHibernated download - Antlr3,Iese,log4net and NHi...

hibernate - createCriteria or createAlias?

If I want to search those students who take class "Math" and "John" is his group: shoud I use createCriteria or createAlias? Criteria: Criteria criteria = session.createCriteria(Student.class); Criteria subquery1 = criteria.createCriteria("courses", course).add(Restrictions.eq(course.name, "Math")); Criteria subquery2 = criteria.creat...

How to write custom nHibernate dialect?

I am using NHibernate with a legacy rdbms rule engine. I am using GenericDialect but some of the sql generated are not working. If I need to write custom Dialect for this rule engine how do start? ...

Problem with StructureMap/nhibernate setup:

Hi I keep getting the following error: Cannot access a disposed object. Object name: 'AdoTransaction'. The setup follows the example given at http://trason.net/journal/2009/10/7/bootstrapping-nhibernate-with-structuremap.html here is the IUnitOfWork class (exactly the same as the one in the link): public class UnitOfWork : IUnitOf...

How to get Fluent NHibernate working with NHibernate 3.x

How to get Fluent NHibernate working with latest NHibernate 3.x trunk I got the following Exception : Could not load file or assembly 'NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. EDIT : This exception occurs in FluentNhibernate file PersistanceConfiguration publi...

Nhibernate with windows form

I have a asp.net application with Nihbernate setup, now I want to convert it to Windows form application. Here is the code which have been setup in the Global.asax.cs. Can anyone give me some code sample how to do this in Windows form? protected void Application_BeginRequest(object sender, EventArgs e) { ManagedWebSessio...

When using of full text indexing in sql server give me better performance? In every where or in some situations?

I write a big application by using of NHibernate ORM. Is using of full text indexing in DB level has advantages for my application performance? does it give me better performance in searches? ...

Mixing Inheritance and Tree Structure with Fluent nHibernate

Part of a model I'm designing is a hierarchy geographic locations. Since there are multiple layers and share some information I decided to use a class hierarchy like this: public class GeographicNode { public virtual int Id { get; private set; } public virtual string Name { get; set; } public virtual GeographicNode ParentNod...

nhibernate cache problem with linq queries

I am seeing some odd behavior from nhibernate caching and cannot understand the reasoning. I am not able to cache queries when doing select operations like query.Select(x=>x).ToList() but can cache when doing: var query = session.Linq<Promoter>(); var p = query.ToList(); Both produce the same sql query and should be doign the sam...

NHibernate: Populate property Order.TotalAmount from OrderItem.Amount

Hi. I have a class called Order that contains a property called TotalAmount and a list called OrderItems. Each order item is like a product and contains a property called Amount (which is like the price). I would like to have TotalAmount return the sum of amounts of those OrderItems that belong to that property. I know two ways of doin...