[nhusers] add constraint

2010-07-06 Thread Kris-I
Hello, I have this code : ISession session = UnitOfWork.CurrentSession; IList list = session.CreateCriteria(typeof(Product)) .AddOrder(Order.Desc("LastUpdate")) .SetMaxResults(number) .List(); I'd like add a constraint : LastUpdate > Cr

[nhusers] Re: Updating one-to-one entity

2010-07-06 Thread xpista
Could you tell me how should I fix it to make it work? What exactly is wrong? Thanks, Stefan On Jul 7, 12:36 am, Fabio Maulo wrote: > Wrong mapping for a bidirectional-one-to-one based on FK > > > > On Tue, Jul 6, 2010 at 10:54 AM, xpista wrote: > > Hi, > > >  I have a problem with updating one

Re: [nhusers] Re: Concurrency Tests

2010-07-06 Thread deepu
hi, What will be the difference between optimistic ans pessimistic database coding in NHIbernate. Can u tell me please.. On Thu, Jul 1, 2010 at 5:02 PM, John Davidson wrote: > NUnit tests do not run from Visual Studio but from the Command Line or > Standalone GUI > > John Davidson > > > On Thu,

[nhusers] Jira Down? #2225 Fix is backwards

2010-07-06 Thread allan.ritc...@gmail.com
Hi Steve I saw you checked this in today. Jira is down so I couldn't file the patch against it public class HqlBitwiseOr : HqlExpression { public HqlBitwiseOr(IASTFactory factory, HqlExpression lhs, HqlExpression rhs) : base(HqlSqlWalker.BAND, "band", factory, lhs, rh

[nhusers] Re: Antlr.Runtime.NoViableAltException - has the HQL syntax changed dramatically?

2010-07-06 Thread gary lucas
I did try (random re-writing) commenting out one then the other parts of the subquery... Both returned the same error. I'll take another look at it tomorow. Thank you both. Gary On Jul 5, 2:29 pm, Fabio Maulo wrote: > First try removing this part >                OR >                actr.Gros

Re: [nhusers] Updating one-to-one entity

2010-07-06 Thread Fabio Maulo
Wrong mapping for a bidirectional-one-to-one based on FK On Tue, Jul 6, 2010 at 10:54 AM, xpista wrote: > Hi, > > I have a problem with updating one-to-one mapped entity. > > In first session I create the class with a property which I map one- > to-one. Cascading is set to "all". > In second

Re: [nhusers] Re: Stateless session performance is slower than statefull session

2010-07-06 Thread Fabio Maulo
have a look to the batcher ;) On Tue, Jul 6, 2010 at 1:05 PM, Henning wrote: > I tried using NH Prof but with no luck. I couldn't get any clear > answer as to why stateless sessions are slower. > > In fact, you'd think that stateless sessions would be much faster > since NHibernate doesn't track

Re: [nhusers] Re: Complex Queries

2010-07-06 Thread Fabio Maulo
On Tue, Jul 6, 2010 at 3:41 PM, Mike wrote: > Thanks for the message, but if I'm using NHibernate I'd like to > totally embrace the NHibernate way. :-) > well... as NH's team leader I can't say, at least publicly, something different but... "NHibernate way" includes even SQL queries. -- Fabio

[nhusers] Re: Setting FetchMode on a grandchild object

2010-07-06 Thread Mike
As an side, can you give me an example of creating a Cartesian product? I've heard the reference several times and I think I understand what it means, but just want some confirmation. Thanks! On Jul 6, 4:12 pm, "Richard Brown \(gmail\)" wrote: > IIRC you can write: > >     .CreateCriteria() >  

[nhusers] Re: Setting FetchMode on a grandchild object

2010-07-06 Thread Mike
That did the trick... thanks! And thanks for the note on performance. I have been working on optimizing my old queries that I did before NHProf. On Jul 6, 4:12 pm, "Richard Brown \(gmail\)" wrote: > IIRC you can write: > >     .CreateCriteria() >     .SetFetchMode(app => app.ApplicationWorkflow

Re: [nhusers] Setting FetchMode on a grandchild object

2010-07-06 Thread Richard Brown (gmail)
IIRC you can write: .CreateCriteria() .SetFetchMode(app => app.ApplicationWorkflows, FetchMode.Eager) .SetFetchMode(app => app.ApplicationWorkflows[0].ApplicationStatus, FetchMode.Eager) .Add(SqlExpression.In(app =>... Also remember to consider performance: http://nhforge.org/blog

[nhusers] Setting FetchMode on a grandchild object

2010-07-06 Thread Mike
I have the following Criteria query (using Lambda extensions): var workflowResult = repository.GetSession() .CreateCriteria() .SetFetchMode(app => app.ApplicationWorkflows, FetchMode.Join) .Add(SqlExpression.In(app => app.ID, uniqueIds))

[nhusers] Re: Complex Queries

2010-07-06 Thread Mike
Thanks for the message, but if I'm using NHibernate I'd like to totally embrace the NHibernate way. :-) On Jun 28, 5:43 pm, Fabio Maulo wrote: > and, btw, if you have an existing SQL (you said " I'm going from something I > was efficient with (relational data)") you can your SQL in NH directly o

[nhusers] NHibernate.Linq -> The method CompareTo is not implemented.

2010-07-06 Thread Nikola Malovic
Here's the problem: in short I use comb.guid identity strategy and I need all the rows made after the saved marker.. Here's dummy code example of what I am trying to get: return session.Linq .Where(p => p.Id.CompareTo(lastSyncedEntityIdentity) == 1 ) .T

Re: [nhusers] Re: Stateless session performance is slower than statefull session

2010-07-06 Thread Diego Mijelshon
You just keep saying that "stateless sessions are slower" without providing any code that we can reproduce. Diego On Tue, Jul 6, 2010 at 13:05, Henning wrote: > I tried using NH Prof but with no luck. I couldn't get any clear > answer as to why stateless sessions are slower. > > In fact, yo

[nhusers] Re: Stateless session performance is slower than statefull session

2010-07-06 Thread Henning
I tried using NH Prof but with no luck. I couldn't get any clear answer as to why stateless sessions are slower. In fact, you'd think that stateless sessions would be much faster since NHibernate doesn't track them. Means less overhead and faster code. Henning On 6 Jul, 02:51, Diego Mijelshon w

[nhusers] Re: can list() returns proxies?

2010-07-06 Thread kor
sorry, i was initializating them with a log :| thanks, it works perfectly -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhus...@googlegroups.com. To unsubscribe from this group, send email to nhusers+unsubscr.

Re: [nhusers] Re: can list() returns proxies?

2010-07-06 Thread Diego Mijelshon
All you have to do is replace that List call with Enumerable (and, of course, the variable should be of type IEnumerable; you can use var and forget about that). If the proxies are being initialized, there's something about your classes that you are not telling us. Diego On Tue, Jul 6, 2010

[nhusers] Updating one-to-one entity

2010-07-06 Thread xpista
Hi, I have a problem with updating one-to-one mapped entity. In first session I create the class with a property which I map one- to-one. Cascading is set to "all". In second I load the entity and try to _replace_ the property. By replace I mean I set it to new instance. What I expect is

Re: [nhusers] Re: Oracle Dialect not working properly with Linq Single function

2010-07-06 Thread Fabio Maulo
Steve, the exception was about missed parameters values (pagination parameters missed). I'll re-install oracle and check it. -- Fabio Maulo El 06/07/2010, a las 05:29, Steve Strong escribió: I think there are actually two separate issues here. Single() & SingleOrDefault() work correctly if th

Re: [nhusers] NHibernate persist Configuration

2010-07-06 Thread Fabio Maulo
That is not my post. Btw the concept is: You can serialize, in a file, a configured Configuration instance one time and then upload the full configured Configuration deserializing the file. -- Fabio Maulo El 06/07/2010, a las 03:57, Ilia Ternovich escribió: > Hello Fabio! > > Thanks for the re

Re: [nhusers] Re: can list() returns proxies?

2010-07-06 Thread Oskar Berggren
One possibility: Project the query results to get just the primary id. Iterate, and use ISession.Load() on each one to get a proxy for the full object. /Oskar 2010/7/6 kor : > can you make an example? i try but i can't use enumerable to add items > to a collection without initialize them > > --

Re: [nhusers] LinqNhibernate / OrderBy and reference

2010-07-06 Thread Steve Strong
Currently, there's no way of explicitly specifying a left join within the Linq syntax that's supported by the current (v3) provider. The approach recommended by Oskar (below) is the standard way of doing a left join within Linq, but right now the provider will throw an UnsupportedException if you

[nhusers] Re: can list() returns proxies?

2010-07-06 Thread kor
can you make an example? i try but i can't use enumerable to add items to a collection without initialize them -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhus...@googlegroups.com. To unsubscribe from this gro

[nhusers] Re: ISQLQuery 1st level cache

2010-07-06 Thread Jag
Meh it seems that blindness is truly a programmer's trait (aka RTFM). Anyhow a full reply so as to not leave the post orphan: 1. The AddEntity() will return a fully managed Entity 2. It hydrates the cache because of (1). The true answer to my question is use the qq.SetResultTransformer(Transform

Re: [nhusers] Re: Oracle Dialect not working properly with Linq Single function

2010-07-06 Thread Steve Strong
I think there are actually two separate issues here. Single() & SingleOrDefault() work correctly if there are zero or one results; they are incorrect if there is more than one result (due to a buggy use of SetMaxResults(1), which I'll fix). But that's not the bug that's being seen here. What And

Re: [nhusers] JoinQueryOver and SelectList

2010-07-06 Thread Richard Brown (gmail)
Hi Graeme, That does sound like a bug can you raise a JIRA for it? Cheers, Richard From: Graeme Foster Sent: Monday, July 05, 2010 2:49 PM To: nhusers@googlegroups.com Subject: [nhusers] JoinQueryOver and SelectList HI all, Not sure if this it the right forum or whethe

Re: [nhusers] NHibernate persist Configuration

2010-07-06 Thread Ilia Ternovich
Thank you Tuna. This is exactly what I need. 2010/7/6 Tuna Toksoz : > It was a sample code for Castle NH Facility. You should concentrate on the > code itself, not the method names. > You can serialize the configuration into a file. You should, however, be > aware of config may have changed, so yo

Re: [nhusers] NHibernate persist Configuration

2010-07-06 Thread Tuna Toksoz
It was a sample code for Castle NH Facility. You should concentrate on the code itself, not the method names. You can serialize the configuration into a file. You should, however, be aware of config may have changed, so you should invalidate it when necessary. http://github.com/castleproject/Castl