|
I would like to write the following SQl in NHibernate - Detached Criteria if possible.
select * from parent INNER JOIN child on parent.id=child.parentid INNER JOIN (select ChildID, MAX(ChildDate) MaxChildDate from child group by ChildID) max ON child....
Started by Stu on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
If you this is the Hibernate reference and not NHibernate....
I can't say I actually know a way of doing what you are asking, NHibernate returns the actual twice and pulling different information doesn't work in NHibernate as far as I am aware.
|
|
I'm quite new to NHibernate and starting to find my way around.
I have a domain model that is somewhat like a tree.
Funds have Periods have Selections have Audits
Now I would like to get all Audits for a specific Fund
Would look like this if I made it...
Started by HAXEN on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
But it does depend on those many-to-many / one-to-many.
Try this
select elements(s.Audits) from Fund as f inner join Period as p inner join Selection as s in fundPeriodSelections select selection.Audit).ToList()
...
|
|
Hey
I have a collection of ReportColumns in a Report object.
The ReportColumns has a DisplayOrder field which sets where abouts in the report the column is displayed. these columns are re-orderable in the designer ui and i can write some hacky code to...
Started by cvista on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Set displayorder = a.rownumber from colmodels cm inner join ( select colmodels.id, row_number a trigger:
IF EXISTS (SELECT name FROM sysobjects WHERE name = 'colmodels_insupd' AND type = 'TR') DROP.
|
Ask your Facebook Friends
|
I have an Article with a Set of Category. How can I query, using the criteria interface, for all Articles that contain all Categories with a certain Id?
This is not an "in", I need exclusively those who have all necessary categories - and others. Partial...
Answer Snippets (Read the full thread at stackoverflow):
Here's the SQL that they show there:
SELECT b represent this ....
FROM Article INNER JOIN ( SELECT ArticleId, count(*) AS MatchingCategories FROM ArticleCategoryMap" with "categories" to map that back to your specific problem.
|