[nhusers] NHibernate.Linq : chain Expand()

2009-10-12 Thread Catalin DICU
Hello, When executing the following code I only get two players for each team and for the first team I even get two times the same player (there are more than 2 players in each team) INHibernateQueryableMatch queryable = session.LinqMatch();

[nhusers] Linq To NHibernate: Where clause invoking Model public virtual method fails

2009-10-12 Thread CarmineM
Hi to everyone, FIrst and foremost, I'm a newbie of NHibernate and Linq to NHibernate. I have an User model class defined as follows: public class User : IAggregateRoot { public virtual int Id { get; private set; } public virtual string Login { get; set; }

[nhusers] Interesting mapping problem

2009-10-12 Thread Victor Rosenberg
Hey guys I'll go straight to the problem... I have a class called File, a class called ProductFile (that inherits from File) and a class called SeamlessProductFile that inherits from ProductFile. Now, another class called Header has to hold 3 different properties that list Files, ProductFiles

[nhusers] NH Warning (NHProof Alert)

2009-10-12 Thread Mauro Servienti
Hi, Running NHProof profiling my current solution it issues a warning saying that one of my custom type is not serializable (WARN: custom type is not Serializable). Googling around seems that the warn is emitted by nhibernate if the custom user type does not implement the ISerializable

[nhusers] Re: Is it possible to find dirty property

2009-10-12 Thread Igor
BTW why don't you use Interceptor to do all this logging stuff? And maybe it will be more reliable to put this logic into DB itself (trigger, or stored procedure for create/update)... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[nhusers] Re: Selecting a deep object graph

2009-10-12 Thread Stephane Farges
Hi, Yes, my Cities collections are loaded with this request without further access to the database.(I'm sure of that, because when I use the cities, the session is closed, so no lazy loading is possible) Are you sure you didn't forget .SetFetchMode(Countries, FetchMode.Eager) for one of the

[nhusers] Whats going on Transaction.Commit() and what I have to do for doing nothing?

2009-10-12 Thread Armin Landscheidt
Hallo together, at the moment I'am wondering what's going on on transaction.Commit()? I'am loading an object in a transaction, doing some work with it but I don't call session.Update(). At the end I call transaction.Commit(). But why are the changes on the object in my database? Why ist Commit()

[nhusers] Re: NH Warning (NHProof Alert)

2009-10-12 Thread Felix Gartsman
The warning is wrongly worded. The not serializable type is not the custom type, but its return type, i.e. IUserType.ReturnedType. On Oct 12, 9:43 am, Mauro Servienti mauro.servie...@gmail.com wrote: Hi, Running NHProof profiling my current solution it issues a warning saying that one of my

[nhusers] Re: NH Warning (NHProof Alert)

2009-10-12 Thread Valeriu Caraulean
As I remember, serializability of the IUserType is checked by looking at IsSerializable property (of System.Type) on the IUserType.ReturnedType. Try return a serializable type by IUserType.ReturnedType. On Mon, Oct 12, 2009 at 9:43 AM, Mauro Servienti mauro.servie...@gmail.com wrote: Hi,

[nhusers] Re: NH Warning (NHProof Alert)

2009-10-12 Thread Mauro Servienti
Interesting, thank you. Now the problem is that my IUserType.ReturnType is an interface and obviously interface cannot be marked as [Serializable] and I don't want to implement the ISerializable interface, because I don't need it. .m -Original Message- From: nhusers@googlegroups.com

[nhusers] Re: NH Warning (NHProof Alert)

2009-10-12 Thread Mauro Servienti
I solved the problem slightly changing the implementation of my user type, returning from ReturnType the type of the concrete implementation and not the interface. Thanks to all for the suggestions. .m -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com]

[nhusers] Re: Whats going on Transaction.Commit() and what I have to do for doing nothing?

2009-10-12 Thread Oskar Berggren
NHibernate is designed to automatically track changes to your entities and save these on transaction commit. If you don't really intend to do those changes, probably you should avoid changing the object at all. (In general, changing properties of a persisted object could have an effect on the

[nhusers] Manually Indexing an Entity with NHibernate Search

2009-10-12 Thread Ricardo Peres
Hi, I'm trying to manually index an entity, that is, not on the PostInsert, PostDelete and PostUpdate events. I have this code, which isn't doing anything: SearchFactoryImpl searchFactory = SearchFactoryImpl.GetSearchFactory (cfg); Work work = new Work(entity, entity.Id, WorkType.Add); //also

[nhusers] Re: Is it possible to find dirty property

2009-10-12 Thread Ramin
Some interesting aspects here. Fabio, you suggest the INotifyPropertyChanged event. I have some points about that suggestion (hoping to get responses, because I am trying to wrap my head around the best way to do these things). First, you would have to use the nosetter.* strategy to fill the

[nhusers] Re: Selecting a deep object graph

2009-10-12 Thread Thomas Koch
Hi Stephane - Yes, I am pretty sure I remembered everything. The only difference compared to your setup is that I have four nested levels and also need to specify some restrictions on the rows returned. I only want all the nested rows filled for one of the top- level entities. Anyway, thanks

[nhusers] Re: Objects not getting dirty, so commit does nothing

2009-10-12 Thread Trinition
I just created a new solution and project, copying over the bare minimum pieces. In this cleanup, the problem is NOT occurring. The test is consistently UPDATEing the rows. I don't feel like I cut out anything fundamental that would've side- stepped my issue. While I was hoping to have some

[nhusers] Mapping Component Inheritance

2009-10-12 Thread Mauro Servienti
Hi all, is there a way to achieve component inheritance mapping? class SubjectValue{} class PersonValue : SubjectValue{} class CompanyValue : SubjectValue{} class Agreement { public SubjectValue Subject{ get; set; } } Based on a discriminator in the Agreements table? Any other solution,

[nhusers] Re: Generic version of Session.Load() is useless when lazy loading?

2009-10-12 Thread Skafa
I ran in this exact same issue. You cannot use the generic version of Load in combination with specifying a proxy for your class. If you think about it for a second, it does make sense. The generated proxy does not implement (override) your mapped class. It implements the proxy you specified.

[nhusers] Re: Generic version of Session.Load() is useless when lazy loading?

2009-10-12 Thread Fabio Maulo
It seems to be a feature request:session.LoadTMappedClass, TProxy(object id) 2009/10/12 Skafa r@rawsoft.nl And, ofcourse, you should do the casting yourself: var skill = (ISkill) session.Load(typeof(Skill), id); On 30 sep, 07:16, Richard Dingwall rdingw...@gmail.com wrote: I have the