QueryOver is a strongly-typed fluent-like wrapper on top of NHibernate ICritieria, a database-agnostic query API that supports query composition.
Questions tagged [queryover]
740 questions
0
votes
1 answer
fluent hibernate Transformers.AliasToBean is not working as expected
I have three tables. One is the master table: TableA. One table is referenced by TableA called ReferencedTable and lastly a lookup table referenced by ReferencedTable.
I have this query that returns the ten most recent objects as:
TableADTO…

Bill Nielsen
- 866
- 2
- 7
- 18
0
votes
1 answer
Multiple Subqueries With QueryOver
I need help converting this sql query into QueryOver Nhibernate criteria.
select distinct * from event e where e.name like '%req%'
or e.Id in (select r.eventId from requirement r where r.name like '%req%')
or e.Id in (select r.eventId from…

chamo
- 3
- 3
0
votes
1 answer
get total number of comments for entity using query over
I am trying to get the total comments for an entity yet I am getting back incorrect results.
How would I get a Task and its comments counts (eagerly loaded)
var tasks = _session.QueryOver(() => taskAlias)
…

Haroon
- 3,402
- 6
- 43
- 74
0
votes
1 answer
nhibernate: project a Parent from a child-query
I have the following entities
public class ArticleCategory
{
public int Id {get; set;}
public string Name {get; set;}
public IList Articles {get; set;}
}
public class Article
{
public int Id {get; set;}
public string Name {get;…

Arikael
- 1,989
- 1
- 23
- 60
0
votes
1 answer
Nhibernate QueryOver - .SelectCount() with predicate
I need to select count of row with a condition:
Query to collect the full count:
var searchs = searchQuery.SelectList
(list => list
.SelectGroup(order => order.Id).WithAlias(() =>…

Ievgen Martynov
- 7,870
- 8
- 36
- 52
0
votes
1 answer
Dynamically add projections to NHibernate query
Trying to implement following queries in NHibernate QueryOver.
SQL
SELECT
SUM(GrossChargeAmount)
FROM Charges
INNER JOIN Account on Account.Chargekey = Charges.Chargekey
SELECT
SUM(GrossChargeAmount),
Account.AccountHolder
FROM…

Alex
- 674
- 6
- 18
0
votes
1 answer
Retrieving data from multiple table using hibernate
I have 2 tables namely Library and Book
In Library ->lid , lname,laddress and Setbooks(lid is primary
key)
In Books->bid,bname,bauthor(bid is primary key)
I.e.: library--one to many-->Book
I'm finding difficulty in retrieving List of Library s…

nandu
- 1
- 1
- 1
0
votes
1 answer
How to wrap NHibernate QueryOver API
I wrapped Nhibernate session as the following.
public interface IDalSession : IDisposable
{
void MarkForRollBack();
void End();
IDalSession Start();
IDalSession StartWithTransaction();
T Save(T entity);
T…

SexyMF
- 10,657
- 33
- 102
- 206
0
votes
2 answers
nHibernate aggregate query
I'm attempting to put the following SQL query into an nHiberate QueryOver statement and I'm failing miserably.
Select top 15 percent
People.personId
,People.Name
,SUM(Marks.Score)
from
People
inner join [sessions] on…

Zen-C
- 71
- 1
- 10
0
votes
2 answers
NHibernate taking longer time executing simple query
I am facing very strange issue re NHibernate and now it is become headache.
NHibernate is taking longer time (2-3 minute) than expected time (few milliseconds) to execute such a simple query. The database is Oracle and I am using ODP driver. I have…

Milind
- 65
- 8
0
votes
1 answer
nHibernate count(*) on existing queryover
I'm using nHibernate 3.3. I'd like to execute SQL like this:
select COUNT(*) from (
SELECT YEAR(MeasureDateLocal) As [Year], MONTH(MeasureDateLocal) As [MONTH], DAY(MeasureDateLocal) As [DAY], sum(this_.RainCounterValue) as y3_
FROM…

ZmorzynskiK
- 98
- 7
0
votes
1 answer
nHibernate queryover complex query
I've been battling this all day and can't seem to get the result I want. I want to get all the nodes that has a certain tag in their tag collection.
I'm using this QueryOver command but I'm getting all the possible nodes even though it looks to me…

Phil
- 3,934
- 12
- 38
- 62
0
votes
1 answer
howto query table per hierarchy which subclasses are present
a simple example
abstract class Car
{
public virtual long SerialNumber { get; set; }
}
class Mercedes : Car { }
class Fiat : Car { }
class Toyota : Car { }
now i want to query for which types inheriting from car are on stock. How to do this?…

Firo
- 30,626
- 4
- 55
- 94
0
votes
1 answer
Nhibernate return a specific type of union subclass in a QueryOver with join
This is my current nhibenate query
MappedHSPItemDto itemDtoAlias = null;
TItem itemAlias = default(TItem);
return
Session.QueryOver()
.JoinAlias(x => x.Item, () =>…

reggieboyYEAH
- 870
- 3
- 11
- 28
0
votes
3 answers
How do I make this NHibernate QueryOver query return rows for empty groups
The following NHibernate QueryOver query is counting the number of applications for each month, within a given date range.
However, I don't get any results for months that don't have any applications in them but I want to actually have Count = 0…

Sandor Drieënhuizen
- 6,310
- 5
- 37
- 80