[nhusers] Re: Invalid index for this SqlParameterCollection - hbm.xml

2009-04-27 Thread bdaniel7
My model is pretty much like the one described by Ayende in the "" post (http://nhforge.org/blogs/nhibernate/archive/2009/04/21/nhibernate- mapping-lt-any-gt.aspx) In OrderItem I have an IPricedModel and mapping to several classes, which implement the IPricedModel. The difference is that those cl

[nhusers] Use criteria API on a map

2009-04-27 Thread Michal
Hi, I am mapping a MAP in one of my domain objects the following way: so AllTitles is an IDictionary in my domain object. How can I create a criteria query which restricts the culture_id or the val of the map. E.g something like that. session.CreateCriteria(typ

[nhusers] Re: IStatelessSession.Insert and uni-directional one-to-many

2009-04-27 Thread Fabio Maulo
mappings? 2009/4/28 mscheibler > > Anybody? > > On 27 Apr., 09:06, mscheibler > wrote: > > Hello, > > > > I have two entities, A and B, with A having a collection of B but > > WITHOUT B having a reference to A. > > Of course the database foreign key column is in table B: > > > > class A { > >

[nhusers] Re: IStatelessSession.Insert and uni-directional one-to-many

2009-04-27 Thread mscheibler
Anybody? On 27 Apr., 09:06, mscheibler wrote: > Hello, > > I have two entities, A and B, with A having a collection of B but > WITHOUT B having a reference to A. > Of course the database foreign key column is in table B: > > class A { >   ICollection Bs { get; } > > } > > class B { >   ... // do

[nhusers] Re: Oracke Transaction

2009-04-27 Thread Anthony Dyer
not really sure- the one that runs with Visual Studio and c# 0 so I assume .net did not know there were different Anthony Dyer Director of Technology, Transportation (847) 954 4526 or (847) 699-6620 anthonyd...@frontiernet.net www.logility.com

[nhusers] Re: Oracke Transaction

2009-04-27 Thread Anthony Dyer
thanks for the help I think I got pass the problem by changing the parm on the mapping Anthony Dyer Director of Technology, Transportation (847) 954 4526 or (847) 699-6620 anthonyd...@frontiernet.net www.logility.com -Original Message- From

[nhusers] Re: Crash in CastleProxyFactory.GetProxy

2009-04-27 Thread Fabio Maulo
There is something wrong in some where else.As advise... try to recreate the same issue outside your application in a NUnit test with or without WatIn. 2009/4/27 Rémi Després-Smyth > > As newb you should use at least NH2.0.1. > > > Btw, you are using a proxy with a closed session. > > > > I’m

[nhusers] Re: Crash in CastleProxyFactory.GetProxy

2009-04-27 Thread Rémi Després-Smyth
> As newb you should use at least NH2.0.1. > Btw, you are using a proxy with a closed session. I’m using NHibernate 1.2.1.4000 because this is an existing app; that was the current version when it was built originally. The session is opened during the HttpApplication’s BeginRequest event, an

[nhusers] Re: Oracke Transaction

2009-04-27 Thread Erik Lundby
Are you looking for nhibernate(.net) or hibernate(java)? Erik From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of Anthony Dyer Sent: Monday, April 27, 2009 3:54 PM To: nhusers@googlegroups.com Subject: [nhusers] Re: Oracke Transaction that is what is installed- w

[nhusers] Re: Oracke Transaction

2009-04-27 Thread Anthony Dyer
that is what is installed- would it make a difference if we upgraded? If so, how do we do it- I downloaded the hibernate-3.3.1 and un-zipped the jar file- but do not see any setup.exe or build.bat (which seemed to be referenced on 1 web page) suggestions? Anthony Dyer Director of Technolog

[nhusers] Re: Oracke Transaction

2009-04-27 Thread Fabio Maulo
NH1.2.0 ?!!?!!??Really ? 2009/4/27 Anthony Dyer > > Anyone has any ideas of how to get around this problem? > > Anthony Dyer > Director of Technology, Transportation > (847) 954 4526 or (847) 699-6620 > anthonyd...@frontiernet.net > www.logility.com > > > > > > -Original Message- > From:

[nhusers] Re: Oracke Transaction

2009-04-27 Thread Anthony Dyer
Anyone has any ideas of how to get around this problem? Anthony Dyer Director of Technology, Transportation (847) 954 4526 or (847) 699-6620 anthonyd...@frontiernet.net www.logility.com -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of

[nhusers] LazyInitializationException Issue

2009-04-27 Thread Andyk
Hi, could anyone kindly spot the obvious, Im getting a "Failed to initialise" exception on my code and I cant see why. [Test] public void Should_be_able_to_insert_a_child_category() { string parentName = "Electronics"; string childName = "Televisio

[nhusers] Re: Version

2009-04-27 Thread Greg Young
Correct Erik. The type can map to different types but instances will map to only a single aggregate root. I don't believe I chose the customer -> order example and you are right I don't like it because its two aggregates. Greg On Mon, Apr 27, 2009 at 5:07 PM, Erik Lundby wrote: > >>> I though

[nhusers] Re: Version

2009-04-27 Thread Erik Lundby
>> I thought earlier you had written something about OrderLine belonging to two >>different kinds of order, one which was raising and one which was raised. I >>can't find it now though so I may have been someone else. I think was talking about the class is able to have two different kinds of p

[nhusers] Re: reload filter

2009-04-27 Thread Fabio Maulo
Try to remove the '.' (dot) in the name of the parameter. 2009/4/27 Michal > > Thanks Fabio.. I guess you are right. > Do you have a suggestion how I could change that in order to use HQL/ > Criteria? > > > On Apr 27, 7:35 pm, Fabio Maulo wrote: > > 2009/4/27 > > > > > They do in my case cause

[nhusers] Re: Problem with filter definition and property's formula

2009-04-27 Thread Fabio Maulo
2009/4/27 s_tristan > > And the parcer in this case will replace myfi...@myfieldprefix with > value from filter definition? Obviously NO. I don't think that exists a single RDBMS doing that. -- Fabio Maulo --~--~-~--~~~---~--~~ You received this message becaus

[nhusers] Re: Explanation of proxy behaviour with HQL queries

2009-04-27 Thread Graham Bunce
/bump Anybody? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhusers@googlegroups.com To unsubscribe from this group, send email to nhusers+unsubscr...@googleg

[nhusers] Re: Version

2009-04-27 Thread Peter Morris
> An instance of an entity always belongs only to a single aggregate root. I thought earlier you had written something about OrderLine belonging to two different kinds of order, one which was raising and one which was raised. I can't find it now though so I may have been someone else. The pro

[nhusers] Re: NHibernate.Impl.CollectionEntry in 2.0.1

2009-04-27 Thread Fabio Maulo
What you are doing ? 2009/4/27 Arman > > hi, > > i was using nhibernate 1.2.1 , now i moved to 2.0.1 and i saw that > there is no implementation for class Nhibernate.Impl.CollectionEntry > in this version, where is it ? is it moved to other namespace? > or what is it's equivalence ? > > thanks.

[nhusers] Re: Crash in CastleProxyFactory.GetProxy

2009-04-27 Thread Fabio Maulo
2009/4/27 Rémi Després-Smyth > This doesn’t look wrong to me, though. A little help to a newb? > As newb you should use at least NH2.0.1. Btw, you are using a proxy with a closed session. -- Fabio Maulo --~--~-~--~~~---~--~~ You received this message because y

[nhusers] Re: Crash in CastleProxyFactory.GetProxy

2009-04-27 Thread Rémi Després-Smyth
Looking into this further, I have found that this property from the mapping file appears to be the guilty party: If I comment the property out, I don’t crash. In my (SQL Server) database, this field is defined as a bit which allows nulls. On my class, the property is read-only, def

[nhusers] Re: Version

2009-04-27 Thread Greg Young
On Mon, Apr 27, 2009 at 2:02 PM, Peter Morris wrote: > > >>> > While I am aware that we could sprinkle our locks around .. should we > have to? Can we avoid these types of hard to find copy/paste bugs by > allowing say a declaration that an object is an aggregate root? > << > > Take into account

[nhusers] Re: Version

2009-04-27 Thread Peter Morris
>> While I am aware that we could sprinkle our locks around .. should we have to? Can we avoid these types of hard to find copy/paste bugs by allowing say a declaration that an object is an aggregate root? << Take into account though that your logical region of validation differs based on what

[nhusers] Re: Oracke Transaction

2009-04-27 Thread Anthony Dyer
yes- it works in fine in SQL Plus and also was using PL/SQL Developer (another 3rd party Oracle GUI interface). Anthony Dyer Director of Technology, Transportation (847) 954 4526 or (847) 699-6620 anthonyd...@frontiernet.net www.logility.com -Ori

[nhusers] Re: Version

2009-04-27 Thread Greg Young
I don't have any notion of fetching strategies because if possible I avoid RDBMS. While I am aware that we could sprinkle our locks around .. should we have to? Can we avoid these types of hard to find copy/paste bugs by allowing say a declaration that an object is an aggregate root? Greg On Mo

[nhusers] Re: Version

2009-04-27 Thread Peter Morris
>> Customer Contact Address for the sake of discussion let's imagine that these are all entities .. Customer c = CustomerRepo.Fetch(id); c.Contact.Address.Street = "testing"; UnitOfWork.Commit(); << Your use-case knows why you are doing what you are doing. So it would load + loc

[nhusers] Crash in CastleProxyFactory.GetProxy

2009-04-27 Thread Rémi Després-Smyth
This may be much too vague, but… NHibernate version 1.2.1.4000. I’m trying to load an entity using GetById. CastleProxyFactory.GetProxy is crashing, no exception. Specifically, in this method: public INHibernateProxy GetProxy(object id, ISessionImplementor session)

[nhusers] Re: Oracke Transaction

2009-04-27 Thread Oscar Orduz Acosta
Hello Anthony: If you execute the select on sqlplus, does it work fine? (by your log you have to replace question mark with 63) Oscar 2009/4/27 Anthony Dyer > > I got the logging working. > I am getting this error: > > [ SELECT this_.user_nbr as user1_0_0_, this_.name_txt as name2_0_0_, > this

[nhusers] Re: Several queries ....

2009-04-27 Thread Kris-I
Found : IList results = Session.CreateMultiQuery() .Add(Session.CreateQuery("from Order o ORDER BY o.DateAdded DESC") .SetMaxResults(10)) .List(); 2009/4/27 Kris-I > And with a syntax like this : > > IList results = Session

[nhusers] Re: Oracke Transaction

2009-04-27 Thread mhanney
In hibernate.session.jpg IdentityColumnString throws an exception because Oracle has no built in mechanism for identity key generation. This is probably the same reason forthis warning: WARN 2009-04-27 11:09:04 - System.ArgumentException: identifier type mismatch Parameter name: id. How are you d

[nhusers] Re: Version

2009-04-27 Thread Greg Young
We can always start sprinkling code like this around but how do we rationalize that its actually happening? One question ... here you seem to have order and customer as two aggregate roots, I am more worried about what happens when its something within our aggregate root. Again we could use the l

[nhusers] Re: Oracke Transaction

2009-04-27 Thread Anthony Dyer
I got the logging working. I am getting this error: [ SELECT this_.user_nbr as user1_0_0_, this_.name_txt as name2_0_0_, this_.pass_txt as pass3_0_0_, this_.email_txt as email4_0_0_, this_.user_id as user5_0_0_, this_.style_txt as style6_0_0_, this_.ldap_ind as ldap7_0_0_, this_.sys_user_id as sy

[nhusers] Re: Several queries ....

2009-04-27 Thread Kris-I
And with a syntax like this : IList results = Session.CreateMultiQuery() .Add(Session.CreateQuery("from Order o ORDER BY o.DateAdded DESC")) .Add(Session.CreateQuery("from Order o ORDER BY o.DateUpdate ASC")) .List(); ? Thanks, 2009/

[nhusers] Re: Version

2009-04-27 Thread Peter Morris
>> with AOP the problem is finding the root (it might be 5 levels deep). I was looking at Peter's suggestion but don't like what it requires. I am currently looking at a way to do this only in proxies but the trick is in finding out what aggregate root we are under while not having the id carried

[nhusers] Re: Oracke Transaction

2009-04-27 Thread Anthony Dyer
Never mind- I got the logging working Anthony Dyer Director of Technology, Transportation (847) 954 4526 or (847) 699-6620 anthonyd...@frontiernet.net www.logility.com -Original Message- From: Anthony Dyer [mailto:anthonyd...@frontiernet.net] Sent: Monday, April 27, 2009 9:41 AM

[nhusers] Re: Version

2009-04-27 Thread Peter Morris
> I was hoping some people had some brilliant solution that had just alluded > me :( Could your solution be either to use Get with a lock mode Session.Get(customer, LockMode.Write); or if you already have the customer reference via a repository just to lock it? Session.Lock(customer, L

[nhusers] Re: Invalid index for this SqlParameterCollection - hbm.xml

2009-04-27 Thread cws
Hi! I think there are three: 1: using dynamic update and insert and don't set both properties especially not to different values. 2:See this nice blog posts http://nhforge.org/blogs/nhibernate/archive/2009/04/09/nhibernate-mapping-lt-many-to-one-gt.aspx see (6) and (7) to omit from database com

[nhusers] Re: Version

2009-04-27 Thread Greg Young
> if entity is PurchaseOrderLine > Update Purchase Order i don't think it can be based on type. CompletedPurchaseOrder and InProcessPurchaseOrder can both have PurchaseOrderLineItems. > IMHO, since we are going to live with this fact there's no need to achieve > it all, and may be the solution

[nhusers] Re: Version

2009-04-27 Thread Sidar Ok
>> As I go through this though I keep hearing "too much magic" being whispered in my ear. and >> with AOP the problem is finding the root (it might be 5 levels deep) If you find the root, without knowing about the inverse relationship, that's gonna be magic in any framework. So to prevent it, I

[nhusers] Re: Version

2009-04-27 Thread Greg Young
Those are all possibilities ... with AOP the problem is finding the root (it might be 5 levels deep). I was looking at Peter's suggestion but don't like what it requires. I am currently looking at a way to do this only in proxies but the trick is in finding out what aggregate root we are under wh

[nhusers] Re: Version

2009-04-27 Thread Sidar Ok
Isn't this a good candidate for AOP ? So when a child entity's version is updated, whether by NH or externally, you go and update the aggregate root(s) too. If you see this as a business decision, and don't want to put it in AOP, may be an event driven solution would do ? Child publishes HeyIHaveB

[nhusers] Re: Version

2009-04-27 Thread Greg Young
Yeah that's about what I thought ... it gets ugly also when you start going n levels deep and end up having to walk bunches of bi-directional relationships. This is something that really needs to be a first class concept to work without being too complex. I was hoping some people had some brillia

[nhusers] Re: Error: Creating a proxy instance failed

2009-04-27 Thread Oskar Berggren
The proxy must be able to derive from the class, so the class' constructor must be public or protected. /Oskar 2009/4/27 Rémi Després-Smyth > I’m using NHibernate version 1.2.1.4000. > > > > I was getting a "Creating a proxy instance failed." Error; looking into it > further, the inner except

[nhusers] Re: Several queries ....

2009-04-27 Thread Jason Meckley
something like var list = session.CreateMultiQuery .Add("select top 5 o from table_one o order by o.[field to sort on] desc") .Add("select top 5 o from table_two o order by o.[field to sort on] desc") .Add("select top 5 o from table_three o order by o.[field to sort on] desc") .List(); var one =

[nhusers] Re: reload filter

2009-04-27 Thread Michal
Thanks Fabio.. I guess you are right. Do you have a suggestion how I could change that in order to use HQL/ Criteria? On Apr 27, 7:35 pm, Fabio Maulo wrote: > 2009/4/27 > > > They do in my case cause i am using them in formula. > > I know that somebody write something with a trick where a para

[nhusers] Error: Creating a proxy instance failed

2009-04-27 Thread Rémi Després-Smyth
I’m using NHibernate version 1.2.1.4000. I was getting a "Creating a proxy instance failed." Error; looking into it further, the inner exception was being thrown by _proxyGenerator.CreateClassProxy(_persistentClass, _interfaces, initializer, false); In NHibernate.Proxy.CastleProxyFacto

[nhusers] NHibernate.Impl.CollectionEntry in 2.0.1

2009-04-27 Thread Arman
hi, i was using nhibernate 1.2.1 , now i moved to 2.0.1 and i saw that there is no implementation for class Nhibernate.Impl.CollectionEntry in this version, where is it ? is it moved to other namespace? or what is it's equivalence ? thanks. --~--~-~--~~~---~--~~

[nhusers] Re: Problem with filter definition and property's formula

2009-04-27 Thread s_tristan
And the parcer in this case will replace myfi...@myfieldprefix with value from filter definition? On 27 апр, 15:25, Fabio Maulo wrote: > That is not a formulaCan you write something like this ? > select yourfi...@yourfieldprefix from Something > > 2009/4/27 s_tristan > > > > > > > > > I have a

[nhusers] Several queries ....

2009-04-27 Thread Kris-I
Hello, I have 3 tables, I'd like to get the 5 last records of each table what is the best way to do this ? Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send em

[nhusers] Re: reload filter

2009-04-27 Thread Fabio Maulo
2009/4/27 > They do in my case cause i am using them in formula. I know that somebody write something with a trick where a parameter in formula is set trough a filter but it is not a documented feature. Filter can work only using HQL/Criteria. -- Fabio Maulo --~--~-~--~~-

[nhusers] Re: Problem with filter definition and property's formula

2009-04-27 Thread Fabio Maulo
That is not a formulaCan you write something like this ? select yourfi...@yourfieldprefix from Something 2009/4/27 s_tristan > > I have a property mapping when I need a dynamic SQL substitution: > > formula='MyProperty:MyFilterDef.DynamicPrefix'/> > > And corresponding filter definition: > >

[nhusers] Problem with filter definition and property's formula

2009-04-27 Thread s_tristan
I have a property mapping when I need a dynamic SQL substitution: And corresponding filter definition: Then I send this parameter to a session: string MyVar = "MyVar"; session.EnableFilter("MyFilterDef").SetParameter("DynamicPrefix", MyVar); But this does not work - parser does no

[nhusers] Re: Invalid index for this SqlParameterCollection - hbm.xml

2009-04-27 Thread bdaniel7
And is there a solution for this? On Apr 26, 10:39 pm, cws wrote: > Hello! > > Little hard to read the mappings, but I encountered kind of same. > > With this mapping: > > update="true" > >     >         >     >     >     >     cascade="save-update"/> >     class="Kurskatalog" cascade="s

[nhusers] Re: "Having" on projection alias using Criteria API

2009-04-27 Thread Gustavo Ringel
Look in the doc: http://nhforge.org/doc/nh/en/index.html#querycriteria-detachedqueries 2009/4/27 Kenneth Siewers Møller > > Hi there > > I am working on a rather complex query using the Criteria API. My > problem is that I need to test using having on a subquery projection. > Is that even possi

[nhusers] "Having" on projection alias using Criteria API

2009-04-27 Thread Kenneth Siewers Møller
Hi there I am working on a rather complex query using the Criteria API. My problem is that I need to test using having on a subquery projection. Is that even possible? Something like this: var projections = Projections.ProjectionList() .Add(Projections.Property("my.Property", "property")) .Add(

[nhusers] current state of working with criteria

2009-04-27 Thread Dotan N.
Hi all, can anyone comment about practices regarding some sort of fluent usage of criteria to build queries? so far i've got NHQG nhlambdaextensions l2nh thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "nhuser

[nhusers] Re: reload filter

2009-04-27 Thread mgabru
They do in my case cause i am using them in formula. eg On Apr 27, 2009 11:20am, Germán Schuager wrote: > I think that filters do not apply when you are getting an entity by id > (get/load), just when you issue a query using HQL or criteria. > On Mon, Apr 27, 2009 at 12:37 AM, Michal mga...@

[nhusers] IStatelessSession.Insert and uni-directional one-to-many

2009-04-27 Thread mscheibler
Hello, I have two entities, A and B, with A having a collection of B but WITHOUT B having a reference to A. Of course the database foreign key column is in table B: class A { ICollection Bs { get; } } class B { ... // does not have reference to A } table A { ID int, ... } table B { ID int