[nhusers] many-to-many with enum

2010-02-02 Thread sirrocco
I have a many-to-many association and I was wondering if I can map the many-to-many element to an enum like: (DaysOfWeek is an enum) This doesn't work, but maybe there's a better way ? -- You received this message because you are subscribed to the Google Groups "nhusers" group

[nhusers] Recovering from StaleObjectStateException

2009-09-23 Thread sirrocco
This is from an asp.net mvc point of view I have a unit of work that starts roughly around the time the action on the controller begins executing. Now Objects are loaded, changes are made and then a transaction starts when the saving part begins . I actually will have only one class that needs to

[nhusers] Re: OnPreInsert - generates an extra update ?

2009-08-21 Thread sirrocco
> > But are you saying that (2) causes the OnPreUpdate to get called? > > > I guess I could get that answer by commenting out the > > entity.CreatedDate = createdDate and see if the OnPreUpdate gets > > called. > > > Sorry for asking for further clarification. >

[nhusers] Re: OnPreInsert - generates an extra update ?

2009-08-21 Thread sirrocco
ing another problem. > Immediately after running through my OnPreInsert code for all the > entities being created, the OnPreUpdate is called for all the same > entities. > > On Aug 11, 9:57 am, sirrocco wrote: > > > If in an Event , onOnPreInsertI set a property ( RecordSt

[nhusers] OnPreInsert - generates an extra update ?

2009-08-11 Thread sirrocco
If in an Event , on OnPreInsert I set a property ( RecordStamp) like so : var index = Array.FindIndex(names, n => n == "RecordStamp"); if (index == -1) return; state[index] = DateTimeService.Now; Can this cause an update after the insert ? The thing is that after the app enter

[nhusers] Re: DefaultSaveEventListener - set RecordStamp on modified entity

2009-07-16 Thread sirrocco
/7/16 Raul Carlomagno > > > > maybe this can be useful for you > > > >http://nhforge.org/wikis/howtonh/simple-audit-metadata-and-logical-de... > > > > On 16 jul, 14:06, sirrocco wrote: > > > > Anyone ? > > > > > On Jul 16, 8:52 am, sirrocco

[nhusers] Re: DefaultSaveEventListener - set RecordStamp on modified entity

2009-07-16 Thread sirrocco
Anyone ? On Jul 16, 8:52 am, sirrocco wrote: > Is there any way to know if the entity from the SaveOrUpdateEvent > object has been modified since the time it was loaded ? > > There are objects that are loaded and not modified at all and I want > to set the RecordStamp only on

[nhusers] DefaultSaveEventListener - set RecordStamp on modified entity

2009-07-15 Thread sirrocco
Is there any way to know if the entity from the SaveOrUpdateEvent object has been modified since the time it was loaded ? There are objects that are loaded and not modified at all and I want to set the RecordStamp only on those that have been modified. I can't find a property to check for this in

[nhusers] Re: HQL Parameters

2009-07-06 Thread sirrocco
So there's no way of using the HQL without specifying typed parameters ? Damn. Oh well, thanks for your help. On Jul 6, 4:13 pm, Fabio Maulo wrote: > Change NHDataSource source in order to provide typed parameters. > > 2009/7/6 sirrocco > > > > >

[nhusers] HQL Parameters

2009-07-06 Thread sirrocco
Hi, I've been using NHibernateDataSource for a while now and it used nhibernate 1.2. I'm changing to version 2.1.0 of NH and I ran into a problem : Internally NHDataSource builds an HQL query and then sets parameters with : query.SetParameter(p.Name, p.Value); p.Value is an objects and comes f

[nhusers] Re: Subquery with top 1

2009-03-10 Thread sirrocco
I did say that I'm using v1.2.1 right ? There's no SetMaxResults on DetachedCriteria. I ended up using 2 separate queries - not ideal but it will do. Thanks anyway. On Mar 10, 2:25 pm, Fabio Maulo wrote: > SetMaxResults > > 2009/3/10 sirrocco > > > > > &

[nhusers] Re: Subquery with top 1

2009-03-10 Thread sirrocco
I can live without the group by, but how do I set a top 1 ? I'm using v1.2.1.4000. - I see that there is a setMaxResults in the trunk - is there no way in v1.2.1.4000 to do this ? On Mar 10, 11:19 am, sirrocco wrote: > SELECT * FROM ProductRenameHistory this_ > WHERE this_

[nhusers] Subquery with top 1

2009-03-10 Thread sirrocco
SELECT * FROM ProductRenameHistory this_ WHERE this_.HistoryKey = (SELECT Top 1 this_0_.HistoryKey as y0_ FROM ProductRenameHistory this_0_ WHERE this_0_.WasRolledback = 0 GROUP BY this_0_.HistoryKey , this_0_.RecordStamp ORDER BY this_0_.RecordStamp desc) The abov

[nhusers] Re: NHibernate2 event architecture

2009-02-15 Thread sirrocco
a > Toksözhttp://turkiyealt.nethttp://tunatoksoz.comhttp://twitter.com/tehlike > > Typos included to enhance the readers attention! > > On Sun, Feb 15, 2009 at 11:51 AM, sirrocco wrote: > > > I'd like to implement something similar (or allot simpler if it turns > > out

[nhusers] NHibernate2 event architecture

2009-02-15 Thread sirrocco
Where can I read more on NH event architecture ? I know I can look at the code, but I'd like to do some reading first. I'd like to implement something similar (or allot simpler if it turns out to be overkill ) so any blogs, articles or replies are appreciated. --~--~-~--~~

[nhusers] Re: Second level cache

2009-01-08 Thread sirrocco
; > Gustavo. > > On Thu, Jan 8, 2009 at 5:51 PM, sirrocco wrote: > > > Hi, I've been following the steps from : > > >http://blogs.hibernatingrhinos.com/nhibernate/archive/2008/11/09/firs... > > , in order to test the second level cache. > > > Now

[nhusers] Second level cache

2009-01-08 Thread sirrocco
Hi, I've been following the steps from : http://blogs.hibernatingrhinos.com/nhibernate/archive/2008/11/09/first-and-second-level-caching-in-nhibernate.aspx , in order to test the second level cache. Now , these are the settings in the config file, true true NHibernate.Cache.HashtableCach

[nhusers] Re: Lazy Loading

2008-12-11 Thread sirrocco
It seems that the FetchMode is working, but at some point the code is touching the Client property (no ideea what that point is). Sorry for all the nagging :) . On Dec 11, 3:25 pm, "Fredy Treboux" <[EMAIL PROTECTED]> wrote: > Try leaving fetch="join" on many-to-one mapping, but removing lazy="fa

[nhusers] Re: Lazy Loading

2008-12-11 Thread sirrocco
aid it still loads the Client > one-by-one, this is correct as you have set fetch="join" which will > force a inner join. You can still use the fetchmode property but you > will have to remove the fetch join from the mapping. > > On Dec 11, 6:20 am, sirrocco <[EMAIL PR

[nhusers] Re: Lazy Loading

2008-12-11 Thread sirrocco
=true, this is the only think that it comes to > my mind. > > > > On Thu, Dec 11, 2008 at 12:56 PM, sirrocco <[EMAIL PROTECTED]> wrote: > > > Modifying the mapping would be more difficult because then I would > > have to modify allot in Code. > > > I would lik

[nhusers] Re: Lazy Loading

2008-12-11 Thread sirrocco
enker" <[EMAIL PROTECTED]> wrote: > you have to set Lazy Load in the mapping of the client class! That is > > > > then it works! > > On Thu, Dec 11, 2008 at 8:58 AM, sirrocco <[EMAIL PROTECTED]> wrote: > > > Hi, > > I have a class ClientXCli

[nhusers] Re: Filter collections

2008-12-11 Thread sirrocco
What you put in the where clause will not be substituted - i think it's raw sql. On Dec 11, 10:41 am, Henning <[EMAIL PROTECTED]> wrote: > hmm, though I noticed, that it seems like the substitutions are not > applied to the where-attribute? > > I want to filter out stuff with "IsActive=true" wher

[nhusers] Lazy Loading

2008-12-10 Thread sirrocco
Hi, I have a class ClientXClientCriteria that has a property named Client mapped as Now, at some point I don't want to load the Client so i'm trying to force a lazy load. IList listClientXClientCriteria = Repository.CreateCriteria ()

[nhusers] Re: GenerateSchemaCreationScript

2008-12-07 Thread sirrocco _
nd thanks :). > >>> > >>> On Sun, Dec 7, 2008 at 10:45 AM, me <[EMAIL PROTECTED]> wrote: > >>>> > >>>> And I found the ManyToOne in fluentnhibernate - it's References > >>>> > >>>> On Sun, Dec 7, 2008 at 10:42 AM,

[nhusers] Re: GenerateSchemaCreationScript

2008-12-07 Thread sirrocco
quot; <[EMAIL PROTECTED]> wrote: > one-to-one should be one to many > > On Sun, Dec 7, 2008 at 10:09 AM, sirrocco <[EMAIL PROTECTED]> wrote: > > > I have the folowing mapping file : > > > > lazy="false" assembly="X" namespace

[nhusers] GenerateSchemaCreationScript

2008-12-07 Thread sirrocco
I have the folowing mapping file : It was generated using fluent nhibernet. Now , on GenerateSche

[nhusers] Re: Serialising a NHibernate Object

2008-12-06 Thread sirrocco
You could mark the properties XmlIgnore, or NotSerialized so they are ignored. Or - my choice : create some DTO's that map exactly what you need to send over the wire - that way you have no problems with proxies. So you don't send the Entity , you send the DTO. On Dec 6, 10:31 pm, Steve <[EMAIL P

[nhusers] Re: Can HQL join subqueries?

2008-11-25 Thread sirrocco
It's a bit strange mate :) Here's your first HQL : "from StorageProduct m where m.asOfDateTime in (select max (s.asOfDateTime) from StorageProduct s)" and should be : "from StorageProduct m where m.asOfDateTime in (select max (s.asOfDateTime) from StorageProduct s group by s.storage_id)" But n

[nhusers] Re: Can HQL join subqueries?

2008-11-24 Thread sirrocco
You forgot the Group By in the HQL query. --~--~-~--~~~---~--~~ 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] Re: Can HQL join subqueries?

2008-11-24 Thread sirrocco
You forgot to put the Group By in the HQL query. On Nov 24, 6:40 am, marducci <[EMAIL PROTECTED]> wrote: > I just found another query that satisfies what i need.  The one below > might be easier to write in HQL. > > SELECT * FROM mmt_storage_product > WHERE asofdatetime IN (SELECT MAX(asofdatetim