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
1
vote
1 answer

Nhibernate 3.1 .Net 4.0 - Get Composite-Id from List of Query

I have a MS SQL db with a table that has a composite id. This is my xml configuration file:
Emanuele
  • 21
  • 1
  • 4
1
vote
1 answer

NHibernate statistics

Would it be a perfomance issue when I set generate_statistics to true? Or would this improve performance of NHibernate? Should I always set this to true - also in production system?
BennoDual
  • 5,865
  • 15
  • 67
  • 153
1
vote
2 answers

NHibernate compare concatenated properties

How would you do this Select * from Personnel p where p.LastName + ', ' + p.FirstName + ' ' + p.MiddleInitial LIKE @Employee + '%' using NHibernate (3.0)? So far, I've tried personnel.QueryOver() .WhereRestrictionOn( x => x.LastName…
Jonn
  • 4,599
  • 9
  • 48
  • 68
1
vote
1 answer

nHibernate 3 QueryOver with compound from clause

Does anybody know a way to do compound from clauses - that are possible with Linq to objects - with nHibernate 3 QueryOver syntax. I know its possible with Linq To nHibernate, but I'm still trying to get my head around the queryover apis. Here is…
derSteve
  • 751
  • 3
  • 8
  • 20
1
vote
2 answers

Disable cache for one model

I got a table which is modified by two applications. One of them is using nhibernate. How do I disable caching for that table? Can it be done in the mapping file?
jgauffin
  • 99,844
  • 45
  • 235
  • 372
1
vote
3 answers

Is NHibernate 3.0 built-in Linq provider stable?

Can i depend on NHibernate 3.0 built-in Linq provider to perform complex queries contain aggregate functions such as Max and Min and contains string operations such as Contains, StartsWith, or EndsWith ??
Saw
  • 6,199
  • 11
  • 53
  • 104
1
vote
1 answer

Decorate an IQueryOver using NHibernate 3.0

Trying to decorate an IQueryOver by using some conditional logic. Consider the following code which is a private method on an object representing a customer search. private void addCustomerCriterion(IQueryOver query) where T : Customer …
Joshua Ramirez
  • 422
  • 3
  • 10
1
vote
1 answer

Multiple updates in a single NHibernate HQL statement

I would like to execute the following two statements at once with NHibernate HQL: update CustomFieldValue set Value = :newVal where Key = 1 and Value = :oldVal; update CustomFieldValue set Value = :newVal where Key = 1 and Value = :oldVal; I have…
BennoDual
  • 5,865
  • 15
  • 67
  • 153
1
vote
1 answer

How to log only SQL in NHibernate 3 using Nhibernate-logging?

I'm using Nhibernate-logging appsettings option to use my custom logger, implementing IInternalLogger and ILoggerFactory, but I only want to log SQL sentences. public class CustomLogger: IInternalLogger, ILoggerFactory { private TraceSource…
Alberto Juan
  • 76
  • 2
  • 8
1
vote
2 answers

NHibernate & WCF in version 3.0

I've just started a new project which requires a WCF service to handle a distributed environment. I'm still trying to find the best way to implement things. I want to use NHibernate, but I've seen a few different ways to address the serialization.…
Chris Kolenko
  • 1,020
  • 17
  • 32
1
vote
2 answers

Many-to-many association not stored in NHibernate

I'll try to explain the problem precisely. There's an entity A which has a one-to-many relation with B (a collection). In addition, entity B has a many-to-many relation with an entity C. When I first store a transient object of type A, both A and…
Matías Fidemraizer
  • 63,804
  • 18
  • 124
  • 206
1
vote
1 answer

Eagerly loading an association after Get()

I am trying to find a better way to load the relation than this: result = session.Get(id); Course course = result.Courses.FirstOrDefault(); I can do this with QueryOver API like this: result = session.QueryOver() …
Ufuk Hacıoğulları
  • 37,978
  • 12
  • 114
  • 156
1
vote
1 answer

Can I use NHibernate SysCache with Non-Web-Application?

I have a Windows Service which is using NHibernate (3) and SQL Server 2008. WPF-Clients are connecting over WCF to this Service for using DataAccess. My question is now: Can I use SysCache or SysCache2 in this Scenario - or are they only usable in…
BennoDual
  • 5,865
  • 15
  • 67
  • 153
1
vote
1 answer

Extra columns selected when using LInq with NHibernate?

I have two classes Public class Foo { int Id {get;set;} Email DefaultEmail {get;set;} } Public class Email { string main {get;set;} string backup {get;set;} string recover {get;set;} } Public string GetEmail(EnType) { …
Jec
  • 59
  • 3
1
vote
2 answers

In Nhibernate, can I further restrict what goes in a one to many using other criteria in the mapping besides the foreign key column?

I've run into a situation where the Table A object needs to map some Table B records as a one to many, but Table B has so many records linked to a particular Table A record that I want to further restrict which records make it into the one to many.…
Isaac Bolinger
  • 7,328
  • 11
  • 52
  • 90