Questions tagged [nhibernate]

NHibernate is an open source object-relational mapper (ORM) for the .NET framework.

NHibernate is an open source object-relational mapper (ORM) for the .NET framework.

It started as a .NET port of the popular Java ORM Hibernate.

Installation

Installing NHibernate can most easily be done using its NuGet package:

Install-Package NHibernate 

Resources

17428 questions
5
votes
3 answers

NHibernate in C# application, how to manage session

I'm new in NHibernate world and I'm starting to build a simple C# Windows Form Application that imports some XLS files into a DB (SQL2008), elaborates data and than exports a CSV file. I've tried to search some examples to how use and manage…
G.Mennuni
  • 51
  • 3
5
votes
2 answers

What is the difference between 'index' and 'list-index'

For collection mapping in NHibernate with ordered collections such as lists, an index column field must be mapped. I just noticed that, as of NHibernate 2.0, there appears to be a "list-index" property as well, which (I believe) can be used in the…
Remi Despres-Smyth
  • 3,883
  • 3
  • 32
  • 44
5
votes
6 answers

Nhibernate: Get real entity class instead of proxied class

Is there a way to make nhibernate return my class instead of its proxy class? I dont mind if it's not lazy or cant be updated.
ryudice
  • 33,818
  • 31
  • 103
  • 154
5
votes
1 answer

How to do pagination in an NHibernate SQL query with DISTINCT

I have a big and complicate SQL query with a DISTINCT clause that gets run in NHibernate (it's a search query with a wide variety of criteria and joins). But I'm having a problem using pagination with it under SQL Server 2008. My question is: how…
ligos
  • 4,210
  • 1
  • 22
  • 34
5
votes
1 answer

.NET ORMs - What advantage does NHibernate (or SubSonic or whatever) give over using Entity Framework?

I'm wondering, what are the main reasons for not to use the built-in Entity Framework? I've read that it's disliked because of its bad implementation, but is this all? And is it still true? (I don't remember the publish date of the article) I know…
l3dx
  • 2,868
  • 6
  • 30
  • 40
5
votes
4 answers

Non ASCII characters in C# identifiers Referenced by NHibernate

I have tried to enter non ASCII characters in C# identifiers, and the program compiles and runs just fine (at least at first glance). To be more precise, I use Croatian diacritical characters (čćđšž) in enums. I really need to use these special…
zszep
  • 4,281
  • 4
  • 34
  • 57
5
votes
1 answer

NHibernate 3.1 Query equals

I just updated from NHibernate 2.1 to NHibernate 3.1. I found out that the equals operator for the use of Linq was not implemented for other types then string. I found an article on the internet to solve this problem. This works fine for the basic…
Gerard
  • 1,709
  • 5
  • 15
  • 20
5
votes
2 answers

NHibernate Expression.Like Criteria on Two Fields

I have an Nhibernate object that has the properties Firstname and Surname, and I'd like to be able to query on both fields (Firstname + " " + Surname); e.g. If the search term is "John Doe", this will be matched when John and Doe are in seperate…
RSlaughter
  • 1,171
  • 3
  • 11
  • 22
5
votes
7 answers

Hibernate/NHibernate mapping file editor

I'm looking for an editor that has the help from http://www.hibernate.org/hib_docs/nhibernate/html/mapping.html built in, and allows simple editing of the XML files in a GUI fashion. I realise there's CodeSmith and MyGeneration, but from what I…
Chris S
  • 62,476
  • 49
  • 214
  • 238
5
votes
1 answer

NHibernate.Burrow For Session Management In NH3

I first would like to ask if NHibernate.Burrow works with NHibernate 3.0 (Linq). I would like to use this framework to delegate the complex session handling things to it and just concentrate in the project I'm working on. Also, what other frameworks…
Luis Aguilar
  • 4,121
  • 4
  • 32
  • 52
5
votes
2 answers

NHibernate: mapping entities across multiple DBs on different servers w/o DB link

Using the latest version of NHibernate (and possibly some plugins), is that possible to map entities across multiple databases on different servers without DB link? For the background, I'm looking to implement something loosely similar to what is…
Maxim Gueivandov
  • 2,505
  • 1
  • 18
  • 33
5
votes
1 answer

Delete with QueryOver?

I would like to improve my code when deleting a group of objects in NHibernate (V3). Currently, I iterate on a retrieved collection and I call delete on each object. This generates n+1 SQL statements. I notice that NHibernate Session provides this…
fxkim
  • 353
  • 1
  • 4
  • 11
5
votes
4 answers

What's the relationship between Castle, LinFu and Spring with NHibernate?

I am a newbie to NHibernate and a bit confused about Castle, LinFu and Spring. I understand that NHibernate helps in DDD and one can map entities to database using xml or Fluent NHibernate. But wondering how Castle, LinFu and Spring are associated…
inutan
  • 9,740
  • 25
  • 74
  • 119
5
votes
1 answer

FluentNhibernate mapping of two tables oneToMany using unique instea of primary key in mapping

I' m writing desktop Project in C#. I'm using Nhibernate to communicate with database. Moreover I use FluentNhibernate into mapping of models but I'm stuck in some part of mapping. Here is My mapping Class in ProductMap Loosing Map public…
5
votes
4 answers

Modelbinding database entities in ASPNET MVC

I'm having trouble trying to think what the best way is to recreate a database object in a controller Action. I want to make use of ModelBinders so in my action I have access to the object via a parameter, rather than having to repeat code to get an…
Luke Smith
  • 20,674
  • 7
  • 27
  • 28
1 2 3
99
100