Hi all,
For my datamodel I'm trying to use HiLo or Guid.Comb to generate my
Id's but I seem to overlook something. When I use native or identity
as the generator class objects are stored to the database, when using
HiLo or Guid.Comb no roundtrip towards the database is done.
I have read the various articles on how the generation works, but
still I don't seem to get the objects stored.
I use the following (for the sake of te example simplified) code:
using System;
using NHibernate.Mapping.Attributes;
namespace App.Model
{
[Class(NameType = typeof(Person))]
public class Person
{
private Guid _id;
[Cache(-3, Usage = CacheUsage.ReadWrite)]
[Id(-2, Name = "Id")]
[Generator(-1, Class = "guid.comb")]
public virtual Guid Id {
get
{
return _id;
} set
{
_id = value;
} }
[Property]
public virtual string Name { get; set; }
}
}
--
You received this message because you are subscribed to the Google Groups
"nhusers" 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/nhusers?hl=en.