Questions tagged [queryover]

QueryOver is a strongly-typed fluent-like wrapper on top of NHibernate ICritieria, a database-agnostic query API that supports query composition.

740 questions
0
votes
1 answer

QueryOver Select brings back more results than Count

I am trying to do a search using QueryOver however the results returned, although are right based on the search criteria, are being duplicated. Here is the code I am using to count the results, which works correctly // disjunction to find query…
JConstantine
  • 3,980
  • 1
  • 33
  • 46
0
votes
1 answer

Select child collection IDs without join in nHibernate

I want to select the primary keys of a parent's child collection in a many-to-many relationship without using a join. Due to other constraints that have been removed from this example, the querying must occur on the child level (Tag) instead of…
Sardonic
  • 126
  • 1
  • 4
0
votes
1 answer

GenericADOException was unhandeled using Nhibernate CreateSQLQuery() method

whats wrong with the following code? public IList GetPostsByUser(object UserId) { using (var session = sessionFactory.OpenSession()) { using (var transaction = session.BeginTransaction()) { …
navule
  • 3,212
  • 2
  • 36
  • 54
0
votes
1 answer

SELECT TOP 10 FROM T using CreateQuery/CreateCriteria/QueryOver at Repository Level not at Entity Level

I have been facing problem fetching the latest 10 posts made by user. I wrote the following Nhibernate query as follows. public IList GetLatest10Posts() { using (var session = sessionFactory.OpenSession()) using (var…
navule
  • 3,212
  • 2
  • 36
  • 54
0
votes
1 answer

NHibernate QueryOver to get records which are not older than N days

I have problem while retrieving the records which are not older than 30 days. As today's date is 24 Jun, I would like to select records not beyond than 23rd May. That is I need all records for the days in between 23rd May and Today. For that The…
navule
  • 3,212
  • 2
  • 36
  • 54
0
votes
1 answer

nHibernate Method Delegate or Event is Expected

Client clientAlias = null; Note noteAlias = null; Comment commentAlias = null; query.JoinAlias(() => noteAlias.Client, () => clientAlias) .JoinAlias(() => noteAlias.Comments, () => commentAlias); query.Where(() => clientAlias.Id ==…
joncodo
  • 2,298
  • 6
  • 38
  • 74
0
votes
1 answer

Nhibernate queryover projection on detail entity fields

What I want to do is to be able to use projections with queryover. I have succeeded doing this using projections on first level only using AliasToBean Transformer but when i project on properties from a detail class nhibenate throws the following…
Manar Husrieh
  • 491
  • 1
  • 5
  • 16
0
votes
1 answer

Nhibernate filter on a property inside reference property using query over

I am using NHibernate with fluent mapping. I have the following scenario: public class A { public virtual int ID{get; set;} public virtual B BReference {get; set;} public virtual string aProperty {get; set;} } public class B { …
Manar Husrieh
  • 491
  • 1
  • 5
  • 16
0
votes
1 answer

QueryOver where generator Nhibernate

Hello i got some method that generating where statment programmatically how can i move where generation to other class method anyone can help ? public static List GetList(List
Endiss
  • 699
  • 2
  • 10
  • 23
0
votes
1 answer

Handle null values in queryover projections

I have a counterpart, which has an address, which MIGHT have a country assigned. How do I handle this: InvoiceAddress invoiceAddres = null; Country InvoiceAddressCountry = null; Counterpart counterpart = null; CounterpartTabDTO result = null; //…
CasperT
  • 3,425
  • 11
  • 41
  • 56
0
votes
1 answer

nhibernate fetching lazy loaded collection after I already assigned to the property

I'm using QueryOver and eagerly loading a filtered collection, similar to the following: Part partAlias=null; Session.QueryOver().JoinQueryOver(x=>x.Parts,()=>partAlias) .WhereRestrictionOn(()=>partAlias.Id).IsIn(partIds) .List(); The…
Alex
  • 9,250
  • 11
  • 70
  • 81
0
votes
1 answer

nhibernate join two entity and return another entity

I have a master entity Trnx like that: public class MasterTrnx { private int? _AccountId; private string _Place; private DateTime _ProcessTime; private int _TrnxId; private decimal? _PaymentValue; } And the master's child…
merve_89
  • 41
  • 1
  • 1
  • 7
-1
votes
1 answer

Nhibernate queryover (or lambda Linq) to add count of subquery in projection

given this table TABLE A( IdA NUMERIC PRIMARY KEY ,DescA VARCHAR2(200) ) TABLE B( IdB NUMERIC PRIMARY KEY ,IdA NUMERIC ,DescB VARCHAR2(200) ) i want to select IdA , DescA , Count Of B For Each A into custom DTO projection with is dto is not a…
gt.guybrush
  • 1,320
  • 3
  • 19
  • 48
-1
votes
1 answer

Sql to NHibernate QueryOver

How can I Convert this SQL to NHibernate QueryOver ? select k1.Id,k.sm from tblKarbarg_1 k1 inner join ( select kd.Karbarg_1_id,SUM(kd.MablaghSanad) as sm from tblKarbarg_1_Detail kd group by kd.Karbarg_1_id …
ahmadxml
  • 1
  • 1
-1
votes
1 answer

NHibernate QueryOver condition on several properties

I have this armor table, that has three fields to identify individual designs: make, model and version. I have to implement a search feature for our software, that lets a user search armors according to various criteria, among which their design.…
Jean-David Lanz
  • 865
  • 9
  • 18
1 2 3
49
50