icriteria Questions

7

Solved

I'm trying to generate SQL along the lines of: SELECT t.*, SELECT (...) FROM Title t [trimmed] using QueryOver Title title = null; var q = session .QueryOver(() => title) .Select( Pr...
Spray asked 23/4, 2011 at 7:34

6

Solved

I am trying to query against an IList<string> property on one of my domain classes using NHibernate. Here is a simple example to demonstrate: public class Demo { public Demo() { this.Tags...
Erudition asked 30/7, 2009 at 21:7

3

Solved

Can I use a Criteria to execute a t-sql command to select the max value for a column in a table? 'select @cus_id = max(id) + 1 from customers' Ta Ollie
Tumbledown asked 14/8, 2009 at 14:43

3

Solved

Anyone know how to convert an ICriteria into a DetachedCriteria. I need to use an existing ICriteria as part of a subquery using: .Add(Subqueries.PropertyIn("Name", myDetachedCriteriaSubquery)) ...
Jinny asked 18/11, 2009 at 3:12

4

Solved

What are the performance differences between the hql and criteriaApi and QueryOver? Are there any situations where one is faster or slower than the other? Edit: I extended the question with QueryO...
Immixture asked 16/7, 2010 at 7:7

3

Solved

Assuming the following scenario: class Project{ public Job Job; } class Job{ public Name; } Assuming I want to use the Criteria API to search for all projects whose Job has the name "sumthing...
Nifty asked 22/5, 2009 at 17:44

1

I have a legacy database that I am mapping using NHibernate. The objects of concern are an Account and a list of Notification objects. The objects look like: public class Notification { public v...
Oregon asked 2/3, 2009 at 22:39

1

Solved

These classes have some similar methods but seem to work slightly different. What's the difference between them and when should I use each of them?
Slaphappy asked 13/9, 2010 at 20:41

2

Solved

I'd like to sort my result like this: First I want all rows/objects where a column/property is not null, then all where the colmn/property is null. Then I want to sort by another column/property....
Cyr asked 8/4, 2010 at 16:39

1

Solved

How do I take the "top n" using NHibernate Criteria API? Ideally I'd like to use detached criteria.
Downbow asked 20/7, 2010 at 6:13

2

Solved

I needed to filter a list of results using the combination of two properties. A plain SQL statement would look like this: SELECT TOP 10 * FROM Person WHERE FirstName + ' ' + LastName LIKE '%' + @T...
Exploiter asked 29/5, 2010 at 21:46

2

Solved

I am using NHibernate, and am trying to figure out how to write a query, that searchs all the names of my entities, and lists the results. As a simple example, I have the following objects; public...
Gilemette asked 22/4, 2010 at 15:4

4

Solved

Assuming the following: public class Order { public virtual int OrderId {get;set} public virtual ISet<Product> Products {get;set} } public class Product { public virtual int ProductId {...
Damsel asked 22/7, 2009 at 10:32

1

Solved

I have a Person entity. Every person has a country, I want to select all the distinct countries that have people in them. This Criteria Query returns all the distinct CountryID's criteria.SetProje...
Courtyard asked 18/11, 2009 at 2:0

1

Solved

I have a Person entity belongs to a person has a Country, I want to select all the distinct countries that have people in them. Easy in HQL select distinct p.Country from Person p How can I do th...
Grapple asked 18/11, 2009 at 1:10

1

Solved

Bit of a newbie question as Im getting started with nHibernate. What's the difference between NHibernate.Criterion.ICriterion and NHibernate.ICriteria classes and which should I use for simple "w...
Wojcik asked 28/8, 2009 at 9:35

1

Anyone knows how to use Projections.Conditional to produce something like "case ... when..." The following code gives a wrong query: IProjection isError = Projections.Conditional( Expression.Eq( ...
Kamilah asked 3/8, 2009 at 14:43

2

Solved

I want to create a query which has more than 3-4 Expression.Or ? But Expression.Or just let me to add two Expressions inside it. if (!string.IsNullOrEmpty(keyword)) query .Add(Expression.Or( Ex...
Eleanoraeleanore asked 12/1, 2009 at 0:51

1

Solved

I've started getting to grips with NHibernate. I'm trying to perform a query that selects all records from a table but with an exclusion filter list of IDs, eg. get me all Products except these one...
Dozer asked 22/7, 2009 at 22:37

2

Solved

Can I select a random row using NHibernate's ICriteria API?
Regulus asked 8/4, 2009 at 12:15

7

Solved

I have an "Estate" entity, and this entity has a collection "EstateFeatures"(type:EstateFeature) and EstateFeature has a property "MyFeatureValue". Note: These are the limited properties for the q...
Unparliamentary asked 10/2, 2009 at 22:41
1

© 2022 - 2024 — McMap. All rights reserved.