Questions tagged [nhibernate-projections]
83 questions
0
votes
1 answer
add Nhibernate Projections
Have Employee: BaseEntity class with
public virtual BaseEntity Department {get;set;}
public virtual BaseEntity Position {get;set;}
and BaseEntity class:
public virtual long Id {get;set;}
public virtual long Name {get;set;}
How can I map my…

dbardakov
- 651
- 1
- 8
- 22
0
votes
2 answers
NHibernate projections: How to project QueryOver into list of int?
Trying to project query result into a list of integers. How does one do that? What transformer should be used. AliasToBean does not work as it requires setter.
var accessFeeYears = _session.QueryOver()
…

epitka
- 17,275
- 20
- 88
- 141
0
votes
1 answer
How to save DTO with NHibernate?
What I would like to do:
Get DTO using projections
In UI I edit this DTO object
Save modified object
How can I save DTO object?
Should I requery domain and merge it dto?
Is there a possibility to specify projections for saving?

Vladimir Nani
- 2,774
- 6
- 31
- 52
0
votes
2 answers
adding projection to conjuction
How can I add a projection to this code? I am trying to sort my results according to date created or last updated.
var c = new Conjunction();
c.Add(Restrictions.Where(x => x.IsOpen ==…

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 Conditional projection queries
I have requirement, wherein I have to calculate totals for cash and credit cards separately using conditional projection queries. My below code doesnt work and it gives me datatype mismatch error. Its says the true condition returns decimal and…

developer
- 5,178
- 11
- 47
- 72
0
votes
1 answer
Filtering only negative values using nhibernate projection queries
I am trying to filter only negative values using nhibernate projection queries. Below is my code for it
SearchTemplate RefundTemplate = new SearchTemplate();
RefundTemplate.Criteria = DetachedCriteria.For(typeof(AirBilling), "Ab");
…

developer
- 5,178
- 11
- 47
- 72
-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