[nhusers] HQL and Event Listeners

2011-06-02 Thread Kasi
Hi, I would like to check whether HQL queries fire event listeners such as IPreUpdateEventListener,IPreDeleteEventListener, etc... I have been using criteria which works perfectly with event listeners. Any highligts for HQL query? Thanks. Kasi -- You received this message because you are subs

[nhusers] Re: NHibernate 3.2 Linq with correlated subquery

2011-06-02 Thread scjones
I think the ultimate issue with any solution I come up with is Take does not work within a subquery (using an Any or a Contains). Does anyone know if this plans on being fixed (I can't access Jira at the moment as it seems to be down) -- You received this message because you are subscribed to the

[nhusers] Re: criteria/load/query NOT returning mapped child collection

2011-06-02 Thread fel0niousmonk
OK, doesn't it figure that as soon as I try to find help on a mysterious problem, it vanishes? lol so I'm no longer seeing the unexpected child return count. I'm chalking that up to someone else mucking with the database while I'm troubleshooting. however, I'd really like some advice on the origi

[nhusers] Re: criteria/load/query NOT returning mapped child collection

2011-06-02 Thread fel0niousmonk
i'm still having a problem with this and it's driving me insane!! what I decided to do was query for the parent, then query for the children using the parent's ID (something like .. customer.Children = sess.CreateCriteria() .Add(nhc.Expression.Eq("

[nhusers] QueryOver works but Query do not

2011-06-02 Thread abx
I am facing the following issue in a very This statement works, I get the only employee "John" var employee = session.QueryOver().Where(x => x.Name == "John").List(); but this does not: var employee = session.Query().Where(x => x.Name == "John").ToList(); This is the error i get: The type init

[nhusers] NHibernate 3.2 Linq with correlated subquery

2011-06-02 Thread scjones
Can anyone help with trying to do the following SQL in Linq to NHibernate 3.2? select act.Name from Activity act where 1 = ( select top 1 p.Allow from Permissions p inner join Operations o on p.OperationId = o.OperationId inner join Users u on p.UserId = u.UserId where p.EntitySecurityKe

[nhusers] Re: Oracle blob comare

2011-06-02 Thread srf
I noticed this is also an issue with clob fields which is more of an issue since you can use a clob field to store really large text inforation and you can only do a compare using the dbms_lob package. Is there no other way to query a clob field other than doing a raw query? On Jun 2, 8:24 am, srf

[nhusers] Re: LINQ in Release Mode not working

2011-06-02 Thread Beefy
Well that's my point. There is nothing special, in terms of NH code, that I am doing. I am doing a simple Session.Load() at this point. Something that is covered, abundantly, in the NH tests. Me writing another simple test (a) would duplicate these tests, (b) wouldn't have failed the same way my

Re: [nhusers] Re: LINQ in Release Mode not working

2011-06-02 Thread Maximilian Raditya
OK, good. That's a starting point as we now can isolate the issue, and it's not one in NH code base. I think the reason of the need of your failing test case would become clearer. -- Regards, Maximilian Haru Raditya On Fri, Jun 3, 2011 at 2:52 AM, Beefy wrote: > Yes, I have run all th

[nhusers] Easier way to do OneToOne via ConventionModelMapper ?

2011-06-02 Thread Michael Teper
It took a bit of tweaking, but I got my one-to-one mapping working with ConventionModelMapper. The result is something like this: var mapper = new ConventionModelMapper(); mapper.Class(map => { map.OneToOne(x => x.Data, m =>

[nhusers] Re: LINQ in Release Mode not working

2011-06-02 Thread Beefy
Yes, I have run all the unit tests in both debug and release, and I have also changed the projects to compile the test assemblies themselves in Release to make sure that didn't make a difference. They all pass. I know this much, which is why I'm sure this is something in my code that I am missing.

Re: [nhusers] Re: LINQ in Release Mode not working

2011-06-02 Thread Maximilian Raditya
I'm not sure but it seems it's related to your mapping. How do you map your domain objects? Using hbm.xml files? -- Regards, Maximilian Haru Raditya On Fri, Jun 3, 2011 at 2:39 AM, Beefy wrote: > More fun info: > > When I make the first call a Load, I get this: > > Unable to locate pers

Re: [nhusers] Re: LINQ in Release Mode not working

2011-06-02 Thread Maximilian Raditya
I've just run all 51 tests (1 ignored) in NHibernate.Test.Linq.WhereTests, from the trunk, both in Debug and Release mode, and still I have no issue at all. Have you tried yourself running all the tests in your machine? And how's the result? -- Regards, Maximilian Haru Raditya On Fri,

[nhusers] Re: LINQ in Release Mode not working

2011-06-02 Thread Beefy
More fun info: When I make the first call a Load, I get this: Unable to locate persister: Domain.Model.User Perhaps this can help point to an underlying cause, like the configuration being wrong or something? / Michael / On Jun 2, 3:24 pm, Beefy wrote: > I was told the same thing over in the

[nhusers] Re: LINQ in Release Mode not working

2011-06-02 Thread Beefy
I was told the same thing over in the developer group. As I said there, there is nothing special I am doing here. In fact, the test case I would write there would be the same one that is already there under NHibernate.Tests.Linq.WhereTests.cs This is not an NHibernate bug, it is apparently a bug w

[nhusers] Problem with MultiCriteria and base types

2011-06-02 Thread Cheetah
It seems that the IMultiCritera implementation is broken if any of the ICriteria added to it query base types that require multiple queries (e.g. derived types that have different joined tables). What appears to be happening is that MultiCriteriaImpl.GetResultsFromDatabase assumes that indexes

Re: [nhusers] Re: LINQ in Release Mode not working

2011-06-02 Thread Maximilian Raditya
Michael, I think a simplified test case (bundled in a solution/project would be better) reproducing the issue would be the best shot here. Your failing test case would explain something that is wrong. I've personally never run into your issue so I'm not sure why it happened thay way in your case.

[nhusers] Re: LINQ in Release Mode not working

2011-06-02 Thread Beefy
I fired up the SQL profiler and looked at what I'm getting there. In Release mode, NHibernate is ONLY opening and closing transactions, it is not executing any of the other SQL it needs to. So the real question here would be, can anyone think of any reason, configuration, etc. where NHibernate wo

[nhusers] Re: Upgrade from 2.x to 3.1, LINQ, and Index Out of Range

2011-06-02 Thread Beefy
I have narrowed this down to something in my code that it doesn't like. Please see my other topic, which is more descriptive of my issue, "LINQ in Release Mode not working". On Jun 2, 12:30 pm, Patrick Earl wrote: > It seems like nobody has any initial ideas on this.  If you're > interested in so

[nhusers] LINQ in Release Mode not working

2011-06-02 Thread Beefy
After bouncing around trying to find what is happening, I'm back with a bit more information about my issues... I'm running an MVC app with Fluent NHibernate (NH 3.1). When compiled in Debug mode, everything works splendidly. When compiled in Release mode, NHibernate isn't working. My session is b

[nhusers] Re: Cartesian product with eager fetching

2011-06-02 Thread Michael Teper
This would be the QueryOver equivalent of my LINQ, right? I get the same result as described earlier: var operations = session .QueryOver() .OrderBy(o => o.DateCreated).Asc

Re: [nhusers] Re: Upgrade from 2.x to 3.1, LINQ, and Index Out of Range

2011-06-02 Thread Patrick Earl
It seems like nobody has any initial ideas on this. If you're interested in solving it, I would suggest creating a tiny new project that doesn't depend on any of your code. If you can't reproduce it in a tiny project, start ripping code and dependencies out of your larger project until you find t

[nhusers] custom sort order by position

2011-06-02 Thread Inna
Hi I was wondering if it is possible to set the sort order by position using nhibernate. The position of an item is stored as an integer field in the database. Right now, as the user moves the items up and down i have to keep on re-adjusting the position property for all the items in the collectio

[nhusers] Re: Query problem with new table

2011-06-02 Thread scottl2001
Nothing wrong with the input. There must be some sort of mapping issue. Is there some mapping that needs to take place in NHibernate when adding a new table? Anyone know? On Jun 2, 4:19 am, Oskar Berggren wrote: > The question mark indicates the position of an SQL parameter, and does > not p

[nhusers] Oracle blob comare

2011-06-02 Thread srf
I was trying to do a query where I want to compare a blob column and nhibernate would generate this for oracle: string queryString = "select entityroot0_.ID " + " from TESTSCOTT3.ROOTTESTOBJECT entityroot0_ where entityroot0_.ARRAY1=:p0 "; this would result in the error: inconsistent datatypes: e

[nhusers] Linq and subquery where

2011-06-02 Thread scjones
Hi, I am trying to convert the Rhino Security ApplyPermissionsToQuery to use Linq: private ICriterion GetPermissionQueryInternal(IUser user, string operation, string securityKeyProperty) { UsersGroup[] groups = authorizationEditingService.GetAssociatedUsersGroupFor(use

Re: [nhusers] Query problem with new table

2011-06-02 Thread Oskar Berggren
The question mark indicates the position of an SQL parameter, and does not present a problem in it self. I think you should have an additional level of inner exception that includes some actual error message from the database engine. /Oskar 2011/6/1 scottl2001 : > > Hello all - > > I have an odd

[nhusers] Re: Mapping by convention specify type

2011-06-02 Thread Luka
Yes, That's it Thanks On Jun 2, 12:09 am, Michael Teper wrote: > What you want is map.Property(x=>x.Value, > map=>map.Type(NHibernateUtil.String)); > > -Michael > > On Jun 1, 4:38 am, Luka wrote: > > > > > > > > > ups one small error: > > map.Property(x=>x.Value, > > map=>map.Type()); > > instea