nhibernate-criteria
NHibernate criteria query that sums field from collection
I have a simple one-to-many relationship between table Order and table Line. I want a query that reports each Order entity and the sum of the Line.Value field.[详细]
2023-01-26 14:24 分类:问答CreateCriteria, joining associations
How can I write the following SQL using CreateCriteria: SELECTsa_bec_matricula.* FROMsa_bec_matricula INNER JOIN sa_matricula ON sa_bec_matricula.sa_mtc_num = sa_matricula.sa_mtc_num[详细]
2023-01-25 04:28 分类:问答How do I express this LINQ query using the NHibernate ICriteria API?
My current project is using NHibernate 3.0b1 and the NHibernate.Linq.Query<T>() API. I\'m pretty fluent in LINQ, but I have absolutely no experience with HQL or the ICriteria API. One of my quer[详细]
2023-01-22 08:52 分类:问答Anonymous count with nhibernate criteria?
Is it possible to create a anoynmous count with nhibernate? The below query throws the exception \"No column *\".[详细]
2023-01-21 17:25 分类:问答Composite Id's and Restrictions.IdEq or with comparison in Linq not working as expected
I have an entity where a composite id is used. I changed to code to make use of wrapping the composite id in a seperate key class. I expected that with Linq I could do a comparison on key object and w[详细]
2023-01-19 02:13 分类:问答Hibernate simple criteria query solving problem
I\'m stuck with a very simple criteria query problem: sess.createCriteria(user.class, \"user\") .user_c.add(Restrictions.eq(\"user.status\", 1))[详细]
2023-01-17 03:55 分类:问答NHibernate - How to write this Query: Select parents & find child for each parent that matches a condition
OK, first my simple Domain Model is 2 classes with a one-to-many relationship, a simple Parent -> child relationship. A \'Tweet\' has one or more \'Votes\', but each Vote belongs to just one Tweets et[详细]
2023-01-16 10:43 分类:问答Using NHibernate Restrictions without strings in the property name
When you create a criteria, you can add Restrictions that apply to a property. There are 2 ways of creating a Restriction:[详细]
2023-01-14 02:53 分类:问答How do I use NHibernate criteria queries to load associations based on additional conditions
Let\'s say I have a Cat that has two properties: FavoriteKitten SecondFavoriteKitten These kittens are discriminated by their Rank.[详细]
2023-01-13 12:20 分类:问答Can I create a custom expression without using the where clause?
While I have already solved this issue in a previous question using a native query. I am now wondering if it is possible to create a custom expression that is usable in a Criteria without using the wh[详细]
2023-01-12 20:01 分类:问答