queryover Questions

1

Solved

I have an application and I'm trying to implement DDD concepts. I have my repository class with some method to list entities. I would like to know how can I do a query with QueryOver to filter sepa...
Barri asked 5/6, 2012 at 12:8

3

Solved

I have a list of all distinct account name prefixes (a-z) which I acquire using var accounts = this.SessionManager.GetActiveSession().QueryOver<Account>(); var q = accounts.Select(Projectio...
Jessiejessika asked 29/5, 2012 at 15:0

2

Solved

I would like to get this SQL from NHibernate: SELECT SUM(color_pages) * SUM(total_pages) FROM connector_log_entry GROUP BY department_name But I can't find any arithmetic operation (*) projecti...
Kaduna asked 28/1, 2011 at 13:10

2

Solved

I want to write such a query with QueryOver so that the result SQL will be similar to the following: Select Bar, count(*) from Foo group by Bar having count(*) > 1 How can I do it ?
Doubtful asked 15/6, 2011 at 13:57

3

Solved

I Have a entity with a property referencing other entity (ReferenceEntity in examples). With HQL i can do this: select e.ReferenceEntity from Entity e where e.Id = :entityId NHibernate will giv...
Masquer asked 21/3, 2011 at 14:52

1

Solved

I'm trying to do the equivalent of this SQL Code SELECT ID SUM(CASE WHEN myProperty = 2 THEN 1 ELSE 0 END) as nbRowWithValueOf2, SUM(CASE WHEN myProperty = 3 THEN 1 ELSE 0 END) as nbRowWithValueO...
Aspic asked 19/3, 2012 at 16:52

2

Solved

I have been struggling with this for a while, so I hope some of you QueryOver experts can help. I have a list of blog posts. You can vote on each blog post, and I would like (among other) to recie...
Billyebilobate asked 25/2, 2012 at 13:35

2

Solved

I've looked at the similar questions, but can't find a simple explanation. I could have missed it, but I promise I looked. Actually I can't even find the documentation other than a single blog post...
Deflective asked 14/2, 2012 at 21:50

2

Solved

I have this scenario: class User { Id, UserName } class UserRelationship { User GroupUser, User MemberUser } and query var query = QueryOver.Of<UserRelationship>() .JoinqueryOver(x=>x....
Parisian asked 11/5, 2011 at 14:8

1

Solved

Imagine the following (simplified) database layout: We have many "holiday" records that relate to going to a particular Accommodation on a certain date etc. I would like to pull from the databas...
Quietism asked 2/3, 2011 at 10:42

3

Solved

I'm using NHibernate 3.0 with both the LINQ provider and QueryOver. Sometimes I want to eager load related data, and there comes the method "Fetch" to the rescue, both in LINQ and QueryOver. Now I ...
Cameral asked 26/1, 2011 at 3:44

3

Solved

Hi Is there any elegant way of combining 'like' and 'or' when i'm using queryover API? for 'like' there is something like: query.WhereRestrictionOn(x=>x.Code).IsLike(codePart) for 'or' i ca...
Impart asked 27/12, 2010 at 20:20

2

Solved

I'm looking to incorporate property value translations into my QueryOver queries. I like writing queries following the Query Object Pattern, directly producing MVC view models. In my view models, ...
Unchancy asked 8/8, 2011 at 9:55

1

Solved

I'm trying to create a rowcount-query from a regular query, but the resulting SQL seems to lack the GROUP BY resulting in a wrong count. Does anyone know what I'm doing wrong. First the queries: ...
Tektite asked 4/11, 2011 at 16:54

1

Solved

IHave the following NHibernate query using a subquery: NHContext.Session.QueryOver<Item>() .WithSubquery.WhereProperty(x => x.ItemId).In(QueryOver.Of<Foo>().Where(x => x.AFlag)....
Hulse asked 31/10, 2011 at 18:4

1

Solved

Basically what I want to do is to write this piece of SQL: SELECT CASE WHEN t.type = 'a' THEN t.name ELSE t.otherName END as "Name" FROM myTable t in QueryOver
Intuit asked 26/9, 2011 at 8:4

1

Solved

I have a simple QueryOver var q = SessionInstance.QueryOver<Person>().Where(p => p.Number.Equals(number)); Number field type is int. This query has a runtime error by this message: U...
Slash asked 17/9, 2011 at 13:10

1

Solved

This NHibernate blog entry notes how detached QueryOver queries (analogous to DetachedCriteria) can be created (using QueryOver.Of<T>()). However, looking this over, it doesn't look analogous...
Medlar asked 8/9, 2011 at 19:9

2

Solved

I have been searching for several hours now how to do this, but can't seem to find anything to help me. Here is the database model: This is the SQL query I am trying to run: SELECT b.*, a.Assi...
Tyrannize asked 22/8, 2011 at 21:27

1

Solved

I'm trying to get something similar to the SQL below via QueryOver: SELECT docs.*, (SELECT TOP 1 eventDate from events WHERE id=docs.id AND type=4 ORDER BY eventDate DESC) as eventDate FROM do...
Johan asked 20/8, 2011 at 19:0

4

I have this Repository method public IList<Message> ListMessagesBy(string text, IList<Tag> tags, int pageIndex, out int count, out int pageSize) { pageSize = 10; var likeString = s...
Leader asked 6/1, 2011 at 14:1

3

Solved

I would create a QueryOver like this SELECT * FROM Table WHERE Field IN (1,2,3,4,5) I've tried with Contains method but I've encountered the Exception "System.Exception: Unrecognised method ...
Prohibitionist asked 23/3, 2011 at 16:49

1

I want to do this: NHibernate.IQueryOver<DataAccess.Domain.Product, DataAccess.Domain.Product> query = session.QueryOver<DataAccess.Domain.Product>(); query = query.Where(x => x.Nam...
Downcast asked 30/7, 2011 at 20:14

2

Solved

I've got a pretty complex object graph that I want to load in one fell swoop. Samples have Daylogs which have Daylog Tests which have Daylog Results Daylog Tests have Testkeys, Daylog Results hav...
Guenther asked 20/5, 2011 at 21:24

1

I have a issue in using subquery with queryover. This is what I have var address = QueryOver.Of<Address>() .Where(x => x.City.IsLike("%" + city + "%")).Select(x => x.Person.Id); v...
Crony asked 13/6, 2011 at 8:43

© 2022 - 2024 — McMap. All rights reserved.