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
4
votes
2 answers

NHibernate 3 LINQ - how to create a valid parameter for Average()

Say I have a very simple entity like this: public class TestGuy { public virtual long Id {get;set;} public virtual string City {get;set;} public virtual int InterestingValue {get;set;} public virtual int OtherValue {get;set;} } This…
Rune Jacobsen
  • 9,907
  • 11
  • 58
  • 75
4
votes
2 answers

nhibernate, 0 in foreign key column

I got a legacy database where the value of 0 was used in FK columns to indicate that no relation have been specified. This is not something that I can change in a trivial way. Is it possible to tell NHibernate to treat 0 as null in specified…
jgauffin
  • 99,844
  • 45
  • 235
  • 372
4
votes
4 answers

nHibernate 3 - QueryOver with DateTime

I'm trying to write a query to select using the DateTime. Year as a where parameter, but I'm receiving this error from nunit: NHibernate.QueryException : could not resolve property: Register.Year of: Estudantino.Domain.Events In class Events I've…
Gui
  • 9,555
  • 10
  • 42
  • 54
4
votes
2 answers

What's new NHibernate in 3.0?

Can anyone link to or list the new features of NHibernate 3.0?
Chris S
  • 64,770
  • 52
  • 221
  • 239
4
votes
2 answers

Nhibernate and linq problem

I get the following expression: _senderRepos.Get(s => s.User.Email == fromAddress); which results in could not resolve property: User.Email of: Module.Fax2Pdf.MailToFax.Models.Sender class: public class Sender { public virtual int Id { get;…
jgauffin
  • 99,844
  • 45
  • 235
  • 372
4
votes
2 answers

NHibernate RowCountInt64 returns wrong count with transformed query

I am experiencing a weird error while executing an NHibernate Query. I have a query of type IQueryOver which is filtered and transformed (using DistinctRootEntity, which i am guessing is causing the problem). I create the…
carl
  • 375
  • 4
  • 17
3
votes
1 answer

NHibernate HQL with isnull() in where does not work

I use the fallowing HQL-Query with NHibernate: from Contact a where a.Id in (select x.Person.Id from PersonCompany x inner join x.Company y inner join y.Addresses z where…
BennoDual
  • 5,865
  • 15
  • 67
  • 153
3
votes
2 answers

NHibernate 3 specify sql data type with loquacious syntax

I'm trying to map an Entity with a string property to a varchar column in NHibernate 3 using the new Loquacious API but I can't figure out how to specify the Type to use. I am able to correctly map the entity with NHibernate 2 and…
3
votes
1 answer

NHibernate QueryOver with Left Self Join

I have a table of positions where a position can have a related position (but not necessarily), and every position has a last modified date. I then want to fetch all positions (of a given type) that was modified between two given dates (i.e. either…
Julian
  • 20,008
  • 17
  • 77
  • 108
3
votes
1 answer

Which linq functions are fully supported by NHibernate 3.0 IQueryable

I have been using NHibernate for a while and loved NHibernate.Linq. Now that NHibernate 3.0 is out with Linq built in, I have been looking for some documentation to find out exactly which Linq functions are suppported now and for some reason cannot…
Richard
  • 21,728
  • 13
  • 62
  • 101
3
votes
1 answer

Meaning of 'Disabled ghost property fetching for because it does not support lazy at the entity level'

I have seen this warning in my NHibernate-DataAccess: 'Disabled ghost property fetching for entity because it does not support lazy at the entity level' Does someone know, what does this mean? - What does I have to change to solve this? Here is a…
BennoDual
  • 5,865
  • 15
  • 67
  • 153
3
votes
1 answer

Soft Delete Nhibernate

I want to make a soft delete on my db table...i have apply following statement (as described here http://nhibernate.info/blog/2008/09/06/soft-deletes.html and in a lot of question on SO). Fattura is my table where i want apply logical delete (there…
Luigi Saggese
  • 5,299
  • 3
  • 43
  • 94
2
votes
1 answer

Conditional row count in linq to nhibernate doesn't work

I want to translate following simple sql query into Linq to NHibernate: SELECT NewsId ,sum(n.UserHits) as 'HitsNumber' ,sum(CASE WHEN n.UserHits > 0 THEN 1 ELSE 0 END) as 'VisitorsNumber' FROM UserNews n GROUP BY n.NewsId My simplified…
Łukasz Wiatrak
  • 2,747
  • 3
  • 22
  • 38
2
votes
2 answers

LINQ-to-NHibernate: Cannot use Linq Skip() and Take() with FetchMany

I have these entities: public class BlogPost { public virtual int Id { get; set; } public virtual IList Keywords { get; set; } public virtual IList Comments { get; set; } } public class BlogComment { public…
2
votes
1 answer

NHibernate 3 - How to perform a LIKE on an id/numeric/int

Whilst SQL Server is perfectly comfortable doing: where Id like '45%' (id being an int), NH will complain as it will still try to send the compare value into sql as a SqlParameter of type int when doing: q.WhereRestrictionOn(cl =>…
jenson-button-event
  • 18,101
  • 11
  • 89
  • 155