[nhusers] Projecting property defined in two subclasses

2015-10-26 Thread Igor Evg
Hello! Is it possible to force NHibernate to fetch a property value using CASE WHEN sql-sytax, when this property is defined in a few subclasses? Domain model: [TableName("clazz_A")] public class ClazzA : Entity { public virtual String Name { get; set; } } [TableName("clazz_A1")] pub

[nhusers] Re: Lazy loading in a reattached entity does not work

2009-10-30 Thread Igor
Maybe cascade="lock" will help... It exists in CascadeStyle class, so I suppose it is implemented :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhusers@google

[nhusers] Re: Performance implications of returning a large number of columns

2009-10-30 Thread Igor
First of all I don't think it will be a real problem. But if you really matter, you may use sql-query (of course not bound to your class), or maybe create a bunch of "lightweight" classes that will contain "just" columns/associations you need in particular case. Super-massive/super-universal class

[nhusers] Re: SetFetchMode on ICriteria

2009-10-30 Thread Igor
> But this does nothing, so it is not the same as fetch="select" in your > mapping ! Hmm, I suppose that you have take into account combination of fetch= and lazy= properties in mapping. > Can anyone explain the difference between them, and possibly explain > why Lazy (as it more or less explain

[nhusers] Re: how to deal with a graph of proxies

2009-10-28 Thread Igor
On 21 окт, 18:05, Fabio Maulo wrote: > I'm not so sure that such kind of query has a better performance than 2 or 3 > round-trips. I suppose, there will be more than "just 2 or 3 round-trips", as p.ADDRESSES is collection, and fetching collection and object tree (pretty deep in this case) for ea

[nhusers] Re: how to deal with a graph of proxies

2009-10-21 Thread Igor
You may reattach root object (Person) to session and then perform query that will retrieve all the object graph starting from this person. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to th

[nhusers] Re: Is it possible to find dirty property

2009-10-12 Thread Igor
BTW why don't you use Interceptor to do all this logging stuff? And maybe it will be more reliable to put this logic into DB itself (trigger, or stored procedure for create/update)... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[nhusers] Re: Lazy loading in a reattached entity does not work

2009-10-09 Thread Igor
The problem is that in first case you have NO objects B and C. C doesn't exist at all, while B exist as uninitialized proxy - so when you reattach A in first case - nHibernate will just "initialize proxy for B" - and at the same moment create proxies for C and D objects - next step while processin

[nhusers] Re: cascade="delete-orphans"

2009-10-02 Thread Igor
I always think that cascade="delete-orphan" apply ONLY to collection associations (one-to-many in a set or bag) - not to many-to-one association. And probably there is NO way for nHibernate to know that there are some other references to this city - from another Address object or from object of to

[nhusers] Re: Lazy loading in a reattached entity does not work

2009-09-30 Thread Igor
Maybe missed cascade for object associations? After first call you have 1 detached instance loaded in 1-st session and 1 proxy (to B object). Then you attach A, initialize B proxy, initialize C - so far it worked. Close session - and now you have 3 detached instances A, B and C. Then you try to at

[nhusers] Re: Oracle Generated SQL

2009-09-30 Thread Igor
> So, my questions are: > 1) Why did the style of sql change? I'm also interested in this question! > 2) Can I force NH to generate the ANSI compliant style? Use Oracle10gDialect. As I can see, the only difference between them is ANSI syntax for joins. > 3) How do I specify <> in a mapping fil