Have a scenario where I need to only select a few properties from an
entity, but also collections. This seems such a normal situation, yet
cannot find info on projecting collections - only properties.
Customer customerAlias = null;
Order orderAlias = null;
var list = _session.QueryOver(() => cust
the blog and comments
> query in 1 sql statement.
>
>
>
>
>
>
>
> On Thu, May 10, 2012 at 10:20 AM, Chuck Boyde wrote:
> > I am trying to project a collection of an entity into a DTO. Easy
> > enough with simple properties, but having an issue with collections:
>
I am trying to project a collection of an entity into a DTO. Easy
enough with simple properties, but having an issue with collections:
public class Blog
{
public string Name {get;set;}
public IList Comments {get;set;}
//... more properties
}
public class Comments
{
public Blog Blog {ge
Any advice on how to get a SQL query similar to the following using
linq.
select Competitions.Id,
Competitions.Name,
COUNT(Contestants.Id) as Entries,
SUM(CASE WHEN Contestants.Gender = 'male' THEN 1 ELSE 0
END) as Males,
SUM(CASE WHEN Contestan
I am having a problem getting associated entities to be cached unless
they are specified (Not.LazyLoad() in mapping). If I build up a query
in Criteria or Linq the Main Entity is cached, but not associated
entities.
IList news;
using (var session = factory.OpenSession())
Cape Town - South Africa
On Mar 3, 5:03 pm, spiralni wrote:
> Will be interesting to see where all nhusers lives..
>
> @Cesar Sanz: Nicaragua
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to nhus...@googlegro
Some more cache related problems. I am having a problem getting the
results of associated or child entities to be loaded into the
nhibernate cache along with the root entity when using the Expand()
method. The root entity loads fine though. So the following:
var query = session.Linq();
//var p = query.OrderBy(x =>
x.Name).Select(x=>x).ToList();// will hit the db
}
On Feb 28, 11:44 pm, Chuck Boyde wrote:
> Just downloaded latest build of Linq and same problem. Here is the
> test:
>
> [Test]
> public void Can_Cache()
&g
Fabio Maulo wrote:
> what is in cache is the result of the query not the single entity
>
> 2010/2/27 Chuck Boyde
>
>
>
> > Hi all
>
> > I have come across a problem and don't believe this is by design. I am
> > unable to get nhibernate to use the cach
Feb 28, 4:23 pm, Fabio Maulo wrote:
> The cache can be invalidated in some moment because:
> 1) the cache conf. say "invalidate after N seconds" (default N 5 seconds)
> 2) query space was "touched" by an insert/delete/update
>
> 2010/2/28 Chuck Boyde
>
>
&g
iteLine("Fourth Query");
> var query = session.Linq();
> query.QueryOptions.SetCachable(true);
> query.QueryOptions.SetCacheMode(CacheMode.Normal);
> var p = query.Select(x => x).ToList();
> }
>
query.QueryOptions.SetCachable(true);
query.QueryOptions.SetCacheMode(CacheMode.Normal);
var p = query.Select(x => x).ToList();
}
}
On Feb 27, 10:49 pm, Fabio Maulo wrote:
> what is in cache is the result of the query not the single entity
>
Hi all
I have come across a problem and don't believe this is by design. I am
unable to get nhibernate to use the cache when using a query like:
var acc = session.CreateQuery("from
Account").SetCacheable(true).List();
I have set the following in the config:
NHibernate.Cache.HashtableCacheProvi
Hi All
How do I keep a session available to my view to enable lazy loading of
entities. For example: We have a Customer with Orders and Orders have
Order Lines. In my controller I want get all my customers and pass the
entity to my view. In the view a request may be made to the orders at
which poi
I am busy modeling a financial transaction system. In this system I
have types of financial transactions like payments (representing
purchases of an item) & refunds. Simple for this example.
I have modeled the domain like this so far:
Payment abstract class, inheriting from FinancialTransaction
15 matches
Mail list logo