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

2009-10-14 Thread Remco Ros
Hi Fabio, That is how I currently handle it in our dao's: public TProxy LoadTEntity, TProxy(object id) { return (TProxy) session.Load(typeof(TEntity), id); } Remco On Oct 12, 7:49 pm, Fabio Maulo fabioma...@gmail.com wrote: It seems to be a feature request:session.LoadTMappedClass,

[nhusers] Hydrate+create during flush causes object references an unsaved transient instance error

2009-10-14 Thread Mark Foreman
I have a Parent object with a list of Child objects (one-to-many, cascade-all) and each Child object has an Optional component (many-to-one, cascade- all) ie Parent 1* Child 10/1 Optional When doing a flush/commit i get this error: object references an unsaved transient instance but

[nhusers] Re: How to set default value of a property?

2009-10-14 Thread acl123
You can do it in the mapping like this: property name=SomeProperty column default=myValue / /property Be aware that this doesn't actually create default values for your C# objects. You will need to still do that the traditional way: public class MyEntity { private string _someProperty

[nhusers] issue when using distinct in join query

2009-10-14 Thread graphicsxp
Hi, The following does not work : ICriteria criteria = SessionManager.GetCurrentSession().CreateCriteria (typeof(BuzzUserArt)); criteria.SetCacheable(true).CreateAlias(Owner, owner).Add (Expression.Like(owner.FullName, suggest, MatchMode.Anywhere).IgnoreCase()); criteria.SetProjection(

[nhusers] Re: Encrypting binary columns

2009-10-14 Thread kasvis...@gmail.com
After giving it some thought, I should be able to implement EncryptedBinary which should be a simplified version of the EncryptedString. This difference being that the EncryptedString accepts and returns encoded strings whereas the EncryptedBinary will directly work off Byte []. i am going to

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

2009-10-14 Thread Fabio Maulo
well done. 2009/10/14 Remco Ros r@rawsoft.nl Hi Fabio, That is how I currently handle it in our dao's: public TProxy LoadTEntity, TProxy(object id) { return (TProxy) session.Load(typeof(TEntity), id); } Remco On Oct 12, 7:49 pm, Fabio Maulo fabioma...@gmail.com wrote: It

[nhusers] Interface/subclass mapping

2009-10-14 Thread HJ
I'm trying to persist a class which extends another class. If I pass the superclass to NHibernate I get a no persister for mySuperType which is understandable. So I've tried to extract an interface from my base type and change the mapping to use that, but I get the same error. The two classes

[nhusers] how to deal with a graph of proxies

2009-10-14 Thread Raul Carlomagno
hi, the domain is something like this: a PERSON who has an ilist of ADDRESSES, each ADDRESS has a CITY, each CITY has a STATE, each STATE has a COUNTRY PERSON - ADDRESSES - CITY - STATE - COUNTRY all clases are mapped as proxies, so my form receives a person, with its proxied addreses, ergo,

[nhusers] Re: How to set default value of a property?

2009-10-14 Thread mynkow
10x acl123, but why NHib has such an option then? What is the real purpose of column default=myValue / ? On Oct 14, 11:03 am, acl123 andrewclawre...@gmail.com wrote: You can do it in the mapping like this: property name=SomeProperty     column default=myValue / /property Be aware that

[nhusers] Re: Interface/subclass mapping

2009-10-14 Thread HJ
If it makes a difference, I only ever need to retrieve the entities as their basetype. So regardless of which class is passed to NHibernate the interface properties should always be serialized, but the base type will always be returned. --~--~-~--~~~---~--~~ You

[nhusers] Re: Encrypting binary columns

2009-10-14 Thread Jay
I am using Fluent Nhibernate for the mapping files. I have defined the CustomSqlType as BinaryBlob in the mapping file for the attachment column. I suspect I might have to create a new IUserType to work with BinaryBlob type. On Oct 13, 3:34 pm, Tuna Toksoz tehl...@gmail.com wrote: It is

[nhusers] nHibernate Check Constraint

2009-10-14 Thread Jeremy
Hi, I'm new to using nHibernate. I'm trying to use the check constraint as the column in the database has a constraint that the value must be between 0 and 31. How would I express that in the check constraint? I am battling to find examples on the internet. [Property(CollectionDay, ColumnType =

[nhusers] Ideas for wrapping NH-Linq queries with common DB retry logic

2009-10-14 Thread Graham Bunce
All, In my application I have a repository layer which wraps access to database queries. As NH-Linq has come on the scene we've started using his a lot more for new apps. However, as Linq queries are deferred until first use, I'm not sure how to deal with common DB errors that can be retried -

[nhusers] Re: Manually Indexing an Entity with NHibernate Search

2009-10-14 Thread Ricardo Peres
Even better: using (IFullTextSession searchSession = Search.CreateFullTextSession (session)) { searchSession.Index(entity); } Thanks, Ayende! On Oct 13, 2:36 pm, Ricardo Peres rjpe...@gmail.com wrote: Found it: I had forgot the tx.Commit()! On Oct 12, 11:51 am, Ricardo Peres

[nhusers] problems with sessions on different threads

2009-10-14 Thread Jan Limpens
Hi, NhProf keeps telling me that on _some_ requests of my webb app my session/transactions seem to use multiple threads. And the server sometimes enters into a race condition, where too many requests kill sql server (problems with closing transactions that are already disposed of, sounding just

[nhusers] Automatic aggregate change tracking

2009-10-14 Thread Joe
I'm trying to implement change tracking for my aggregate roots using Ayende's method found at http://ayende.com/Blog/archive/2009/06/11/nhibernate-ndash-automatic-change-tracking-for-aggregate-roots-in-ddd.aspx. I have 2 entities: TestProject and TestClass. Here are my mappings: class

[nhusers] Quotes at PostGre SQL script

2009-10-14 Thread David Leite
Hello all, I am using NHibernate with Fluent to generate sql scripts to a PostGre DB. The problem is that the script generated doesn't has the quotes around the column declarations. Even if you witre the column names in uper case without the quotes, PostGre creates the columns all lower case.

[nhusers] Re: how to deal with a graph of proxies

2009-10-14 Thread Mark Foreman
have you tried configuring lazy=false on the address-city, city- state and state-country links? On Oct 14, 11:24 pm, Raul Carlomagno rcarloma...@gmail.com wrote: hi, the domain is something like this: a PERSON who has an ilist of ADDRESSES, each ADDRESS has a CITY, each CITY has a STATE, each