Here is a very simple AR entity

    [ActiveRecord("Organizations", DynamicUpdate = true)]
    public class Organization : ActiveRecordBase<Organization>
    {
        private Organization(){}

        [PrimaryKey(PrimaryKeyType.GuidComb, "Id")]
        public Guid Id { get; set; }

        [Property("Name", NotNull = true, Length = 50)]
        public string Name { get; set; }
     }

DB Scheme

Id      uniqueidentifier        NotNull
Name    nvarchar(50)    NotNull

Here is what happens when i run my unit test (im using Log4Net)

SELECT organizati0_.Id as Id8_0_, organizati0_.Name as Name8_0_ FROM
Organizations organizati0_ WHERE organizati0_.Id=@p0;@p0 =
54131a04-1e04-4274-ad3c-9fb401682ceb [Type: Guid (0)]
UPDATE Organizations SET Name = @p0 WHERE Id = @p1;@p0 = 'test company
1' [Type: String (50)], @p1 = 54131a04-1e04-4274-ad3c-9fb401682ceb
[Type: Guid (0)]

So as you can see, its pretty straight forward..



On Jan 30, 1:03 am, Mauricio Scheffer <[email protected]>
wrote:
> Yes, as the author of the blog post you mentioned says, this is likely the
> consequence of a mapping error.
> I don't think ActiveRecord has anything to do here... I'd try running a
> test to find mapping issues. Here's a newer version of Fabio's
> "Ghostbusters":http://joseoncode.com/2010/02/05/nhibernate-ghostbuster-version-1-1/
> If that doesn't work, try isolating the issue in a stand-alone test so we
> can diagnose the problem.
>
> --
> Mauricio
>
>
>
>
>
>
>
> On Sun, Jan 29, 2012 at 1:06 PM, Mark Jensen <[email protected]> wrote:
> > Hi
>
> > If i fetch something from the database, dont make any changes and then
> > save my entity. I would expect that no UPDATE statements gets called.
> > How this doesn't seem to be the case.
>
> > I found this post from a guy you had the same problem, but only with
> > NH
>
> >http://ahmedshuhel.blogspot.com/2011/01/nhibernate-send-update-querie...
>
> > And i have tried to add "Not-Null=true" to all the attributes on my
> > entity, but not luck, I stille get an UPDATE statement.
>
> > Is there something wrong with AR or am i missing something?
>
> > br
> > Mark
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Castle Project Users" group.
> > To post to this group, send email to [email protected]
> > .
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> >http://groups.google.com/group/castle-project-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to