nhibernate-projections

NHibernate: how to express a specific "group by" query with criteria

Question: What are the criteria/projections that can generate a following query? SELECT SUBSTRING(Name, 0, 1) FROM Person GROUP BY SUBSTRING(Name, 0, 1) (Obviously this one is easier with DISTINCT, but I'll need counts later, when I fix this one). My approaches: My main problem here is with constants, because if I use Projecti...

NHibernate Criteria select items by the group by and sum of itemid within another table.

public class SearchText { public virtual int Id { get; set; } public virtual string Text { get; set; } } public class SearchTextLog { public virtual int Id { get; set; } public virtual SearchText SearchText { get; set; } public virtual User User { get; set; } public virtual int SearchCount { get; set; } publi...

NHibernate - Querying from a collection of Value Types (non-Entity) to solve Select N+1

I have an entity that represents a Tweet from Twitter like so: public class Tweet { public virtual long Id { get; set; } public virtual string Username { get; set; } public virtual string Message { get; set; } // other properties (snip)... public virtual ISet<long> VoterIds { get; protected set; } } I'm trying to...

Hibernate Many-to-Many Criteria Projection

EDIT> i am at a dead end... so i can continue looking for the main reason .. Please tell me how to make a simple criteria for many to many relationships which has more than one eq restrictions, for an example, how to get the person speaking eng & german in the example shown here... My situation is like this i have two classes person and...