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 <
mauricioschef...@gmail.com>
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 <
don...@gmail.com> 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...