[nhusers] No persister for: error when using NHibernate.Linq (trunk source)

2009-02-25 Thread James Crowley
I'm workingagainst the current trunk of nhibernate and nhibernate.linq. Accessing my data via the standard query methods is fine, but when going via the linq2hibernate provider, I'm getting a MappingException stating No persister for: System.* where * is whatever the first System.* type that

[nhusers] Translate this LINQ to nHibernate?

2009-03-13 Thread James Crowley
Can anyone help me translate the following LINQ query into an nHibernate Criteria clause? from c in session.LinqContent where c.WorkflowStage.Active c.WorkflowStage.TransitionsFromHere.Any(x = userContext.Identity.Roles.Contains(x.Role)) c.Owner.Id ==

[nhusers] Re: Fetching only base type objects in nHibernate

2009-03-16 Thread James Crowley
would fetch both Base and Extedned objects. Is there any way to restrict such behavior to fetch only Base objects? -- James Crowley Managing Director Developer Fusion - Connecting developers worldwide Developer Fusion Ltd | 58 Sandringham Close | Enfield, EN1 3JH mob: 07986 624128 web

[nhusers] Re: Fetching only base type objects in nHibernate

2009-03-17 Thread James Crowley
hehe, thanks Fabio. You shall be the one and only Fabio from now on ;) 2009/3/16 Fabio Maulo fabioma...@gmail.com 2009/3/16 James Crowley james.crow...@gmail.com I asked a similar question a few days ago. Fabio Maulo said: You can call me Fabio or Brutus ;) -- Fabio Maulo P.S. I

[nhusers] Re: Could not resolve property error in NHibernate.Linq

2009-03-18 Thread James Crowley
Anyone? Is this a bug with the current linq library? any workarounds (ideally without having to resort to ICriteria)? Thanks 2009/3/17 James Crowley james.crow...@gmail.com Hey everyone, Is it possible to perform deep where clauses using the current NHibernate.Linq provider? I've got

[nhusers] Re: composite validation with nhibernate validator?

2009-03-30 Thread James Crowley
are the same. Gustavo. On Mon, Mar 30, 2009 at 1:58 PM, James Crowley james.crow...@gmail.comwrote: Is there any way to set up composite validation? For instance, on a UI object that has Password and PasswordConfirm, and they need to both equal the same value? I've seen this in other

[nhusers] Re: composite validation with nhibernate validator?

2009-03-30 Thread James Crowley
sorry, the SomeProperty should be, say Password and PasswordConfirm... with the matching on the groupname :) 2009/3/30 James Crowley james.crow...@gmail.com Thanks Gustavo! Is there any way to make this a little more generic so you can reuse the validator across different objects? Ideally I'd

[nhusers] composite validation with nhibernate validator?

2009-03-30 Thread James Crowley
Is there any way to set up composite validation? For instance, on a UI object that has Password and PasswordConfirm, and they need to both equal the same value? I've seen this in other frameworks, but not nhibernate validator? Thanks James --~--~-~--~~~---~--~~

[nhusers] Deleting a child object from a collection in conjunction with an add

2009-04-01 Thread James Crowley
I have a parent object which has a one to many relationship with an ISet of child objects. When deleting a child object, *everything works fine*. But when deleting a child object *and* adding a new child object in the same transaction, the first child is not deleted. I have the following in the

[nhusers] Re: Inserting entity with assigned ID

2009-04-01 Thread James Crowley
Should NH not detect the entity doesn't already exist in the database, despite the fact it has an ID and insert it? Otherwise what else should we be doing to allow for this? Dan -- http://danny-t.co.uk -- http://danny-t.co.uk -- James Crowley Managing Director Developer Fusion

[nhusers] Re: Deleting a child object from a collection in conjunction with an add

2009-04-01 Thread James Crowley
the deletes first? Thanks James 2009/4/1 James Crowley james.crow...@gmail.com I have a parent object which has a one to many relationship with an ISet of child objects. When deleting a child object, *everything works fine*. But when deleting a child object *and* adding a new child object in the same

[nhusers] Re: Deleting a child object from a collection in conjunction with an add

2009-04-01 Thread James Crowley
this is doing a manual flush, but usually I can refactor to have the actions be in different transactions to order things correctly. On Apr 1, 10:48 am, James Crowley james.crow...@gmail.com wrote: Just realised the issue is to do with the unique constraint. NHibernate seems to be trying

[nhusers] Re: Linq Criteria on properties

2009-04-05 Thread James Crowley
Although it's supported in standard LINQ - by which I presume you mean LINQ to Objects, that's because all the objects are in-memory already. The LINQ to SQL and Entity Framework providers don't support that kind of analysis. Not a trivial thing to implement by any means... 2009/4/4 Arman

[nhusers] NHibernate updating entities that aren't dirty ?

2009-04-06 Thread James Crowley
Can anyone suggest what I might be doing wrong here? I'm seeing SQL updates to an entity (and its joined-subclass entities, as its part of a hirerachy), when the only thing that's been changed is a child collection I'm loading an entity from nHibernate. The entity is the root of an inheritance

[nhusers] Re: Many-to-many problem when removing child object

2009-04-06 Thread James Crowley
You might want to check your cascade options? If you want orphaned entities to be removed, you need to set it to all-delete-orphans... but make sure you understand the implcations of this. See

[nhusers] Re: Many-to-many problem when removing child object

2009-04-06 Thread James Crowley
:19 pm, James Crowley james.crow...@gmail.com wrote: You might want to check your cascade options? If you want orphaned entities to be removed, you need to set it to all-delete-orphans... but make sure you understand the implcations of this. Seehttp:// ayende.com/Blog/archive/2006/12/02

[nhusers] Re: NHibernate updating entities that aren't dirty ?

2009-04-06 Thread James Crowley
of entities being marked dirty when they shouldn't. http://nhforge.org/blogs/nhibernate/archive/2008/10/20/how-test-your-mappings-the-ghostbuster.aspx On Mon, Apr 6, 2009 at 7:48 AM, Fabio Maulo fabioma...@gmail.com wrote: mappings 2009/4/6 James Crowley james.crow...@gmail.com Can

[nhusers] Re: delete generates lots of queries

2009-04-06 Thread James Crowley
Maulo -- James Crowley Managing Director Developer Fusion - Connecting developers worldwide Developer Fusion Ltd | 58 Sandringham Close | Enfield, EN1 3JH mob: 07986 624128 web: http://www.developerfusion.com/ --~--~-~--~~~---~--~~ You received this message

[nhusers] Re: NHibernate updating entities that aren't dirty ?

2009-04-06 Thread James Crowley
are nullable in your entity class if they are nullable in the database. Otherwise null values in the database will become 0 when loaded making the entity dirty without you expecting it. Craig On Mon, Apr 6, 2009 at 10:17 PM, James Crowley james.crow...@gmail.com wrote: Can anyone suggest what I

[nhusers] Re: TransactionScope.RequiresNew

2009-06-21 Thread James Crowley
, //the transaction from 's' is put into Current. // transaction 'a' is current, but aborted here s.Complete (); } // 'a' is already aborted, so is just removed at this point Thanks in Advance! -- James Crowley Managing Director Developer Fusion - Connecting developers

[nhusers] LINQ: order by count() - object reference not set

2009-06-21 Thread James Crowley
hey guys, is there any way to get orderby working in conjunction with group by in the Linq to SQL provider at the moment? for instance: from t in _queryService.ContentAttributeView group t by t.Name into g orderby g.Count() descending select g.Key; fails with [NullReferenceException: Object

[nhusers] Re: LINQ: order by count() - object reference not set

2009-06-22 Thread James Crowley
placido.dine...@gmail.com are you trying to do an orderby without a property name?! Plácido Bisneto .NET Developer Blog: http://cidico.wordpress.com OpenControls: http://opencontrols.codeplex.com 2009/6/21 James Crowley james.crow...@gmail.com hey guys, is there any way to get orderby

[nhusers] READPAST hint for SQL Server

2009-06-26 Thread James Crowley
Is there any way to incorporate this into my query? Or will have to use a stored proc? I'm already using LockMode.Upgrade but need the ReadPast hint too. Thanks! James --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[nhusers] nhLINQ and bitwise queries

2009-08-17 Thread James Crowley
Hi guys, Delighted to see that the LINQ provider has made the 1.0 release. However, am I correct in thinking it still doesn't support bitwise queries? For instance, a query like this: from x in _queryService.SomeObject where (t.PromotionFlags promotionFlag) != promotionFlag (where promotionFlag

[nhusers] Examples of LINQ and Group Bys

2009-08-19 Thread James Crowley
Hey - can anyone give me an example of using a group by in LINQ through nHibernate that actually works? I still can't get this working at all, even something simple like this: return (from a in _queryService.IndexedUrlAttributeView group a by a.Name into g

[nhusers] NHibernate proxy class not lazy loading itself?

2009-08-24 Thread James Crowley
I'm seeing a strange issue whereby accessing a lazy-loaded property I only get the Proxy object that has clearly *not* lazy loaded - it has all its properties null, and just it's ID set. The row definitely exists in the table. Another lazy loaded property (that references an entity already in

[nhusers] Re: NHibernate proxy class not lazy loading itself?

2009-08-25 Thread James Crowley
property/method? http://broloco.blogspot.com/2008/01/nhibernate-identity-map-and-proxies.html Or perhaps an 'internal' method that isn't marked as also protected? http://nhjira.koah.net/browse/NH-1515 Just a thought. Regards, Richard *From:* James Crowley james.crow...@gmail.com

[nhusers] Re: NHibernate proxy class not lazy loading itself?

2009-08-25 Thread James Crowley
Turns out because I was using InternalsVisibleTo (which I realise people have mixed feelings over!) to expose internal members to the fluent nhibernate mapper, this was causing issues. I switched the proxy provider from LinFu to Castle and now its working fine. James 2009/8/25 James Crowley

[nhusers] Re: NHibernate proxy class not lazy loading itself?

2009-08-25 Thread James Crowley
LinFu that wasn't intercepting the property accessor). Thanks for the update. Richard *From:* James Crowley james.crow...@gmail.com *Sent:* Tuesday, August 25, 2009 2:29 PM *To:* nhusers@googlegroups.com *Subject:* [nhusers] Re: NHibernate proxy class not lazy loading itself? Turns out

[nhusers] Avoiding unnecessary join when specifying primary key criteria on related entity?

2009-08-31 Thread James Crowley
Hey, I've noticed that if I write a query that puts a condition on a related entity's primary key, such as _queryService.IndexedUrl.Where(t=t.Author.Id == 29) then nHibernate will join on the Author table, even though it only actually needs to specify AuthorId on the IndexedUrl table as we're

[nhusers] Re: Avoiding unnecessary join when specifying primary key criteria on related entity?

2009-08-31 Thread James Crowley
the best James 2009/8/31 Fabio Maulo fabioma...@gmail.com from Something t where t.Author.id = 29 2009/8/31 James Crowley james.crow...@gmail.com Hey, I've noticed that if I write a query that puts a condition on a related entity's primary key, such as _queryService.IndexedUrl.Where(t

[nhusers] Re: Session-per request problem

2009-08-31 Thread James Crowley
NHibernate. How can I do this? Thanks, Joey -- James Crowley Managing Director Developer Fusion - Connecting developers worldwide Developer Fusion Ltd | 58 Sandringham Close | Enfield, EN1 3JH mob: 07986 624128 web: http://www.developerfusion.com

[nhusers] Mixing lazy loading and pre-loading

2009-09-09 Thread James Crowley
I've just tried making a referenced entity on my domain object set to be fetched with a join (rather than lazy loaded). However, now when I try to access another collection on the same domain object (that is lazy loaded) I get a LazyInitializationException telling me no session or session was

[nhusers] Forcing collection deletes before inserts (due to unique constraints)

2009-11-09 Thread James Crowley
hey guys, I've been using a solution described here: http://stackoverflow.com/questions/706673/forcing-nhibernate-to-cascade-delete-before-inserts in order to force elements in a collection to be deleted before the inserts (there's a unique constraint in place, and the new inserts fail if they

[nhusers] Enlisting an IDbTransaction

2009-12-16 Thread James Crowley
Hey guys, Is there any way to enlist an existing IDbTransaction created elsewhere (rather than starting a new one?). Alternatively, is it possible to get a reference to an IDbTransaction from an existing nHibernate transaction to use elsewhere? (basically need to execute some non-nHibernate db

Re: [nhusers] Enlisting an IDbTransaction

2009-12-16 Thread James Crowley
session.Transaction.Enlist(idbcommand) /Oskar 2009/12/16 James Crowley james.crow...@gmail.com: Hey guys, Is there any way to enlist an existing IDbTransaction created elsewhere (rather than starting a new one?). Alternatively, is it possible to get a reference to an IDbTransaction

Re: [nhusers] Enlisting an IDbTransaction

2009-12-17 Thread James Crowley
anyone? :) 2009/12/16 James Crowley james.crow...@gmail.com Hi Oskar - thanks for the response. Unfortunately I don't have a reference to IDbCommand - just the transaction. what I have is a LINQ to SQL query layer that needs to execute in the same transaction as operations on our domain

Re: [nhusers] Enlisting an IDbTransaction

2009-12-17 Thread James Crowley
Thanks Fabio - that's given me a load more stuff to go and read! 2009/12/17 Fabio Maulo fabioma...@gmail.com Ambient Transaction 2009/12/17 James Crowley james.crow...@gmail.com anyone? :) 2009/12/16 James Crowley james.crow...@gmail.com Hi Oskar - thanks for the response

[nhusers] What's happened to Hornget?

2010-02-26 Thread James Crowley
Does anyone know what's happened to www.hornget.net ? Seems to have been down for a few days at least? Thanks James -- 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

Re: [nhusers] Re: problem in convert the IList into IListT object

2010-03-16 Thread James Crowley
...@gmail.com wrote: Hi I followed the above query but i gor following error The value System.Object[] is not of type Customer and cannot be used in this generic collection. Parameter name: value waruni On Mar 16, 1:53 pm, James Crowley james.crow...@gmail.com wrote: Hi there, You

Re: [nhusers] Re: How to specify eager loading with the new hql based linq provider?

2010-03-16 Thread James Crowley
Ah, great - thank you! On 16 March 2010 12:18, Fabio Maulo fabioma...@gmail.com wrote: extension method 2010/3/16 Paco Wensveen pac...@gmail.com It's available: queryable.Fetch(entity = entity.Property) On Tue, Mar 16, 2010 at 9:34 AM, James Crowley james.crow...@gmail.com wrote: hey

[nhusers] GroupBy support in new LINQ provider?

2010-03-19 Thread James Crowley
Hi guys, I'm doing a bit more work against the new LINQ provider, but am I right in thinking there's not yet any Group By support? I keep hitting [NotImplementedException: The method or operation is not implemented.]

[nhusers] IndexOutOfRange exceptions on current trunk

2010-03-24 Thread James Crowley
Hi guys, I keep getting IndexOutOfRangeException's on the current trunk (with code that worked fine in NH 2.1) because it's looking for the primary key in the resultset with square brackets round the column name ([QueuedTaskId] instead of QueuedTaskId) - I've checked and the exception doesn't

Re: [nhusers] IndexOutOfRange exceptions on current trunk

2010-03-24 Thread James Crowley
); // where 000 is a valid ID of a QueuedJob entity works fine. Fabio - if you need any more info to reproduce just let me know :) On 24 March 2010 12:19, Robert Rudduck rob...@rpowered.net wrote: The ` quotes on the column name are probably doing it. On Wed, Mar 24, 2010 at 6:38 AM, James Crowley

[nhusers] HAVING clause with ICriteria/QueryOver

2010-03-25 Thread James Crowley
Is it possible? Most of the docs seem to suggest not, but there also seem to be some patches (for the Java version of hibernate) floating around like here:

[nhusers] Keeping hitting limitations on this query - can't GROUP BY on entity, and can't limit results for subquery?

2010-03-30 Thread James Crowley
Hi guys, I'm hoping to do a query like this: select content.Id from {0}View content join content.Tags tags where (content.Id != :itemId) and tags.Name in (:tags) group by content having count(tags) 0 order by count(tags) desc, content.PublishedDate desc I don't care whether it's HQL, Linq,

Re: [nhusers] Re: Keeping hitting limitations on this query - can't GROUP BY on entity, and can't limit results for subquery?

2010-03-30 Thread James Crowley
I had the group by because you can't otherwise include the having and order by clauses over the tags child collection? (unless I'm missing something here!!) On 30 March 2010 16:05, kor korkl...@yahoo.it wrote: why do you need to group by content?, do you mean samething as 'select distict

[nhusers] Thread safety problem in QueryParameters.PrepareParameterTypes ?

2010-04-23 Thread James Crowley
Hi guys, Are you aware of a threading issue within QueryParameters.PrepareParameterTypes? I've got two threads (operating over different sessions) that, when run starting from the same execution point at the start of the PrepareParameterTypes method. All works fine when the other thread is

[nhusers] Generate nHibernate cfg file from Configuration instance?

2010-05-04 Thread James Crowley
Hi guys, I've searched around for this but with no luck. Is there any way for me to generate an nHibernate configuration file from a Configuration instance (that has been already configured by some external code?). Just looking for an easy way to mimic this external code with a static XML file...

Re: [nhusers] Re: [nhibernate-development] Thread safety problem in QueryParameters.PrepareParameterTypes ?

2010-05-04 Thread James Crowley
Rahien aye...@ayende.com wrote: There _was_ a problem there, IIRC. I am pretty sure that we fix that. Are you using the latest? Can you provide a failing test? On Fri, Apr 23, 2010 at 3:09 PM, James Crowley james.crow...@gmail.comwrote: Hi guys, Are you aware of a threading issue within

Re: [nhusers] Re: [nhibernate-development] Thread safety problem in QueryParameters.PrepareParameterTypes ?

2010-05-05 Thread James Crowley
Anyone managed to try this? Should just be a case of opening the proj and running the test. Would be good to know I'm not going crazy. Thanks :) James On 4 May 2010 21:24, James Crowley james.crow...@gmail.com wrote: Hi guys, I've posted a ZIP with a unit test up here: http

Re: [nhusers] How to retrieve row count of one-to-many relation while also including original entity?

2010-05-18 Thread James Crowley
email to nhusers+unsubscr...@googlegroups.comnhusers%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/nhusers?hl=en. -- --- James Crowley CEO, developerFusion - the global developer community - http://www.developerfusion.com/ CTO, TechEye

Re: [nhusers] How to retrieve row count of one-to-many relation while also including original entity?

2010-05-18 Thread James Crowley
PM, James Crowley james.crow...@gmail.com wrote: I too would be interested to get people's suggestions on how best to do this? You can't seem to get the AliasToBean transformer to deal with the fact we want to set properties on a child property of the DTO either? Would appreciate any

[nhusers] Unable to cast object of type 'NHibernate.Impl.ExpandedQueryExpression' to type 'NHibernate.Linq.NhLinqExpression'

2010-06-02 Thread James Crowley
I'm intermittently (again!) seeing this error on the trunk: System.InvalidCastException Unable to cast object of type 'NHibernate.Impl.ExpandedQueryExpression' to type 'NHibernate.Linq.NhLinqExpression'. at NHibernate.Linq.TypeHelperExtensionMethods.As[T](Object source) in

[nhusers] Using a ICompositeUserType in queries

2010-06-07 Thread James Crowley
Hi guys, I've got a ICompositeUserType implementation that works great when saving/persisting entities... but it doesn't seem to work when using it as a parameter in a query? Instead, it seems to try and binary serialize the type instead and pass that in as the value to the query? Any pointers

[nhusers] Re: Using a ICompositeUserType in queries

2010-06-07 Thread James Crowley
I should add - the type itself doesn't inherit ICompositeUserType... but the implementation to use is specified in the mapping. On 7 June 2010 13:34, James Crowley james.crow...@gmail.com wrote: Hi guys, I've got a ICompositeUserType implementation that works great when saving/persisting

Re: [nhusers] NH3.0 Alpha1

2010-07-26 Thread James Crowley
...@googlegroups.com. To unsubscribe from this group, send email to nhusers+unsubscr...@googlegroups.comnhusers%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/nhusers?hl=en. -- --- James Crowley CEO, developerFusion - the global developer

Re: [nhusers] NH3.0 Alpha1

2010-07-26 Thread James Crowley
the date of final release, I will inform the team ASAP. Thanks. On Mon, Jul 26, 2010 at 11:24 AM, James Crowley james.crow...@gmail.comwrote: Guys - just covering this release on Developer Fusion - http://www.developerfusion.com/news/84984/nhibernate-3-alpha-1-available/. Was hoping to check

[nhusers] Query on ICompositeUserType column works with Criteria/QueryOver but not Linq

2010-07-28 Thread James Crowley
Hi guys, I've got three unit tests, using Criteria, QueryOver and Linq respectively (see below) - the first two passes fine, but the last one fails with a No persister for: System.Uri error. The mapping on the column is: property name=WebSite

Re: [nhusers] IUserType and LINQ

2010-08-31 Thread James Crowley
David, there's a JIRA on this issue here: http://216.121.112.228/browse/NH-2234 On 16 August 2010 23:03, Diego Mijelshon di...@mijelshon.com.ar wrote: I don't think so. Diego On Mon, Aug 16, 2010 at 11:08, David Pfeffer byte...@bytenik.com wrote: Hi all, Is there a way to specify

Re: [nhusers] Can't retrieve Group By entities or by composite keys with Nhibernate's Linq

2011-01-10 Thread James Crowley
I've hit the same issue - did you find a solution? If you find a way while still using LINQ (rather than having to bring in direct NH dependencies on HQL/QueryOver) please do post back here! Not sure if there's a JIRA bug for this stuff, but would seem like a common requirement? Thanks! James

Re: [nhusers] Re: Dynamically built LINQ query no longer working in NH3.0

2011-01-10 Thread James Crowley
In case anyone else comes across this and are looking for a short-term fix, I just ended up just chaining several Where expressions together instead - so var item = something.Where(t=t.xx) if (condition) item = item.Where(t=t.yy) and so on. On 7 January 2011 11:46, José F. Romaniello

[nhusers] Querying by Id in LINQ and first-level cache

2011-01-11 Thread James Crowley
Hi guys, If I'm just passing an IQueryableT reference, is there any way to take advantage of the first-level cache when fetching entities by id? Or is it still the case that I'd need to go via the Get/Load methods on the ISession interface? Many thanks James -- You received this message

[nhusers] QueryOver - adding conditions to outer joins

2011-03-23 Thread James Crowley
Hi folks, Is there a way to specify additional conditions to outer joins (rather than them appearing in the WHERE clause) ? I need some extra conditions on the outer join-ed table, but adding them to the WHERE clause does not get the correct behaviour (see

[nhusers] Re: QueryOver - adding conditions to outer joins

2011-03-23 Thread James Crowley
Sorry - ignore this! Just spotted an identical post from just a few days ago with the answer. CreateAlias(string associationPath, string alias, JoinType joinType, ICriterion withClause) Thanks On 23 March 2011 19:43, James Crowley james.crow...@gmail.com wrote: Hi folks, Is there a way