Re: [nhusers] IsDirty() flushes new collection entities

2010-10-07 Thread John Davidson
The use of sequence is similar to identity in that the db generates the id stored rather than the other id generators which create the id within NHibernate. For your problem the issue identified in jira NH-2136 is the same. The solution is to use an NHibernate created id from hi-lo or guid based

[nhusers] Split/Map object property (string) to several/multiple/many/more than one database fields?

2010-10-07 Thread Trygve Lorentzen
(The verbose subject is because I'm trying to create the best possible search engine hit rate for any topic I post so others will have a higher chance to find the answer) My question is simple, is it possible to map a string property in a Domain Object split into several DB fields with the

Re: [nhusers] Split/Map object property (string) to several/multiple/many/more than one database fields?

2010-10-07 Thread Fabio Maulo
IUserType implemented as multicolumn type. On Thu, Oct 7, 2010 at 8:03 AM, Trygve Lorentzen try...@lorentzenconsult.com wrote: (The verbose subject is because I'm trying to create the best possible search engine hit rate for any topic I post so others will have a higher chance to find the

[nhusers] Re: IsDirty() flushes new collection entities

2010-10-07 Thread cremor
Sadly, a different ID generator is no option for me. My application is not the only one accessing the DB and the other systems rely on these sequences. What is the reason for getting an ID and flushing the Child when checking IsDirty()? Shouldn't it be enough for NHibernate that the ID of the

Re: [nhusers] Re: IsDirty() flushes new collection entities

2010-10-07 Thread John Davidson
You probably need to do an id check yourself first, before the IsDirty. John Davidson On Thu, Oct 7, 2010 at 7:32 AM, cremor cre...@gmx.net wrote: Sadly, a different ID generator is no option for me. My application is not the only one accessing the DB and the other systems rely on these

[nhusers] Getting an alias of a parent criteria for sql expression in child criteria?

2010-10-07 Thread Amir
Hello, We have a criteria with a child criteria that looks like this: DetachedCriteria criteria = CreateCrtieriaForBlogsPosts(); DetachedCriteria subCriteria = DetachedCriteria.ForComment(...) .Add( Property.ForName(BlogPost.Id). // This is from the blog post

[nhusers] Re: ANTLR.QuerySyntaxException

2010-10-07 Thread bdaniel7
UserAudit is mapped, yes, but it has a property reference to the User and not an int UserId. So I would have to do new UserAudit{Page = , User = LoggedUser} By the way, I'm using Castle AR for persistence. And I don't keep the full User in session, but a slim version, and I load the User only

[nhusers] NHibernate + Windows Azure/SQL Azure

2010-10-07 Thread Tomas Alaeus
Firstly: This is my first time using databases in general together with C#. I've done some work on an Google AppEngine application which uses Spring MVC and I'm now supposed to port this to Microsoft Windows Azure. My first attempt was to utilize Spring and NHibernate for maximum awesomeness.

Re: [nhusers] NHibernate + Windows Azure/SQL Azure

2010-10-07 Thread Fabio Maulo
emh SQL-Azure is not in Azure-Storage. You can use NHibernate to connect to a SQL-Azure server not to Azure-Storage. On Thu, Oct 7, 2010 at 12:02 PM, Tomas Alaeus tala...@gmail.com wrote: Firstly: This is my first time using databases in general together with C#. I've done some work on

Re: [nhusers] Re: ANTLR.QuerySyntaxException

2010-10-07 Thread Fabio Maulo
session.Save(new UserAudit{Page = page, User= session.LoadUser(userId)}); On Thu, Oct 7, 2010 at 11:53 AM, bdaniel7 bdani...@gmail.com wrote: UserAudit is mapped, yes, but it has a property reference to the User and not an int UserId. So I would have to do new UserAudit{Page = , User =

[nhusers] Re-initialize Blob's byte[] in object class.... how to??

2010-10-07 Thread PLen
Hello, I have a Blob database column which gives the following in my class object: public virtual byte[] Body { get; set; } And the following in my NHibernate mapping file: property name=Body column=BODY lazy=true/ NOTE: I am using NHibernate v3.0 A2 to get the property lazy

Re: [nhusers] Re: NHibernate.MappingException: Could not compile the mapping document weird exception

2010-10-07 Thread Diego Mijelshon
IIRC, NH requires .NET 3.5 (I could be wrong) Not sure if that has anything to do with your issue either. Diego 2010/10/6 Vedran Trebović vedran.trebo...@gmail.com We still couldn't manage this problem. Anyone has any idea? -- You received this message because you are subscribed to

Re: [nhusers] Re-initialize Blob's byte[] in object class.... how to??

2010-10-07 Thread Diego Mijelshon
You can't mess with NH Session's internals if you want it to manage things for you. You can always use stateless sessions and retrieve the blob on demand, as part of a different query, for example. That said, you might be interested in this:

[nhusers] Re: Re-initialize Blob's byte[] in object class.... how to??

2010-10-07 Thread PLen
Diego, Thanks for the reply. I figured that the only option was to not use the obj.Body to retrieve the data, but rather to do my own separate direct Oracle call when needed and then handle the byte[] as I see fit. I really didn't want to do that though as I don't want to have a mixed data

[nhusers] Invalid lock mode for loading

2010-10-07 Thread Aaron Fischer
I am using nhibernate 3 and calling session.Loadentity( someId, LockMode.Write) and I revive System.ArgumentOutOfRangeException: Invalid lock mode for loading Parameter name: lockMode at NHibernate.Event.LoadEvent..ctor(Object entityId, String entityClassName, Object instanceToLoad, LockMode