Questions tagged [nhibernate-3]

Use this tag for Nhibernate version 3.x series specific question.

NHibernate is a mature, open source object-relational mapper (ORM) for the .NET framework. This tag refers to the 3.x series of this project.

86 questions
2
votes
1 answer

Calling Fetch in NH 3.1 ignores Skip and Take

We have a query we're attempting to write for paging, where we want to use Fetch to eager load a collection for an object, then return a paged list of that object. The query below does not work because when we look in the profiler, it skips the…
Vadim Rybak
  • 1,677
  • 20
  • 25
2
votes
2 answers

NHibernate get next Birthdays

I have a table which contains a column Birthday of Type DateTime. Now I should select with HQL all Persons which Birthday is in the next 10 days or was in the last 5 days. How can I do this with NHibernate 3.2 HQL? Thanks. Thomas
BennoDual
  • 5,865
  • 15
  • 67
  • 153
2
votes
1 answer

Bound FetchMany in Linq to NHibernate

I am using FetchMany for some of my queries and the NHibernate profiler gives me the following error: WARN: firstResult/maxResults specified with collection fetch; applying in memory! I guess this is because the fetch is unbound. Is there a…
2
votes
1 answer

Future of SchemaUpdate?

I read somewhere that "SchemaUpdate is not recommended in NH2.0.0.". I'm afraid that if this is supported in NHibernate 3 or not? And what's its road map?
Afshar Mohebi
  • 10,479
  • 17
  • 82
  • 126
2
votes
2 answers

NHib 3 Configuration & Mapping returning empty results?

Note: I'm specifically not using Fluent NHibernate but am using 3.x's built-in mapping style. However, I am getting a blank recordset when I think I should be getting records returned. I'm sure I'm doing something wrong and it's driving me up a…
SeanKilleen
  • 8,809
  • 17
  • 80
  • 133
2
votes
1 answer

mapping (by code - not fluent) an FK column as a list of enums in parent entity

I have an entity class that represents a person and an enum that represents permissions that a person has. I am trying to map this relationship to a database using nhibernate mapping by code without any success. The code looks like this: public enum…
Anish Patel
  • 4,332
  • 1
  • 30
  • 45
2
votes
1 answer

Invalid Column in NHibernate Map-by-Code ComponentAsId

I have the following table tblChild FatherCode ChildNumber Name FatherCode and ChildNumber are the primary keys of the table. Since something like this happens very often in this database (I have ZERO control over it), I created the following…
Tejo
  • 1,268
  • 11
  • 18
2
votes
1 answer

NHibernate QueryOver and Collection Filtering

Simple example of my class: public class Post { public IEnumerable Tags { get; set; } } User checks few interested tags for filtering Post list. I need to filter all post by selected tags like: Session.QueryOver() …
Alexander Byndyu
  • 177
  • 1
  • 2
  • 8
1
vote
3 answers

Tell NHibernate to execute an Insert-Statement

I use NHibernate with the Repository-Pattern. The Repositories has the Methods Insert() and Update(). Now, Insert() call Session.Save(entity) and Update() call Session.Merge(entity). My Entities has for the PrimaryKey the fallowing mapping:
BennoDual
  • 5,865
  • 15
  • 67
  • 153
1
vote
1 answer

Delete multiple objects in NHibernate 3.2

In my Repository I have a method like this: public int Delete(Expression> predicate) { var listToDelete = UnitOfWork.Session.Query().Where(predicate).ToList(); foreach(var item in listToDelete) …
amiry jd
  • 27,021
  • 30
  • 116
  • 215
1
vote
1 answer

NHibernate 3.2 many to any mapping by code and inheritance

I have a many-to-any mapping and an inheritance conflict when trying to map my domain like this: public class Member { public virtual int Id { get; set; } // many: public virtual IList IssuedTokens { get; set; } } public…
amiry jd
  • 27,021
  • 30
  • 116
  • 215
1
vote
2 answers

NHibernate - cascade delete is not working

I use NHibernate 3.2 with MS SQL Server 2008 R2 I have the fallowing mappings
BennoDual
  • 5,865
  • 15
  • 67
  • 153
1
vote
2 answers

Multiple database with NHibernate 3.x

I found a couple of articles how to use NHibernate with multiple database, for example this one http://codebetter.com/karlseguin/2009/03/30/using-nhibernate-with-multiple-databases/ But all articles are very old, and may be there is some new…
Yaplex
  • 2,272
  • 1
  • 20
  • 38
1
vote
1 answer

How can I use the VisualStudio 10 Debugger to inspect the underlying nHibernate (3.1) criteria text

Under Windows I have code similar to the following: var active_ids = QueryOver.Of() .Where(m => m.HasAccess); I have found that if I break the debugger after this line and type ?active_ids.criteria the following is displayed: {IsApproved =…
1
vote
2 answers

What can be used as a NHibernate QueryOver alias?

I know so far that a local variable or a local property can be used as an alias like so ClassA _aliasA; _session.QueryOver(x => x.ClassA, () => _aliasA); or ClassA AliasA { get; set; } _session.QueryOver(x => x.ClassA, () => AliasA); I want to…
Jonn
  • 4,599
  • 9
  • 48
  • 68