I opened an issue in GitHub 
<https://github.com/jagregory/fluent-nhibernate/issues/230> about this, but 
it's been idle.  Maybe it's because I'm doing something wrong, so I wanted 
to check here.

Basically, I'm using a special wrapper class around an int for some of my 
entity IDs.  The values are still generated by IDENTITY in the database, 
but the properties in the classes aren't just ints.  I've base a custom 
UserType for it so I could try to fluently map like this:

        Id(x => x.Id)
            .GeneratedBy.Identity()
            .CustomType<BaseIdUserType<FooId>>()
            .UnsavedValue(0);

Fluent NHibernate throws the exception from EnsureIntegralIdenityType(). 
However, if I cheat and work-around Fluent NHibernate's restriction, 
everything works just fine:

        Id(x => x.Id)
            .GeneratedBy.Custom("identity")
            .CustomType<BaseIdUserType<FooId>>()
            .UnsavedValue(0);

Is there some other way to get an Custom UserType to work with the standard 
.Identity() generator?

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fluent-nhibernate+unsubscr...@googlegroups.com.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
Visit this group at http://groups.google.com/group/fluent-nhibernate.
For more options, visit https://groups.google.com/d/optout.

Reply via email to