--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
public virtual Guid Id { get; set; }
and in the map updated it to use the POID generator you suggested:
Id(x => x.Id, "SESSION_ID").GeneratedBy.UuidHex("B");
However, I get an exception from FluentNHibernate when I try to create
a session factory that says that my identity type must be a string.
at
FluentNHibernate.Mapping.IdentityGenerationStrategyBuilder.EnsureStringIdentityType()
at
FluentNHibernate.Mapping.IdentityGenerationStrategyBuilder.UuidHex(String
format)
at NHTest.SessionMap..ctor() in C:\\Projects\\Test\\NHTest\\NHTest\
\Maps\\SessionMap.cs:line 12
The problem centers around trying to get the field to map as a Guid on
the outside. I am thinking that I have to add an alternate access
route like a private field to make this scenario work. Thoughts?
On Mar 7, 1:48 pm, Jason Dentler <jasondent...@gmail.com> wrote:
> Try the uuid.hex POID generator.
>
>
>
> On Fri, Mar 5, 2010 at 12:05 PM, Colin Bowern <co...@bowern.com> wrote:
> > I have an existing database schema where GUID's are being stored
> > inside an Oracle VARCHAR2(50 BYTE) field. In my domain object I am
> > looking to expose this as a Guid. In Fluent NHibernate I don't see an
> > IsCustomType method on the Id object so I am assuming that you can't
> > specify a custom type formatter. How would I make this mapping work?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "nhusers" group.
> > To post to this group, send email to nhu...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > nhusers+u...@googlegroups.com<nhusers%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/nhusers?hl=en.- Hide quoted text -
>
> - Show quoted text -
public virtual Guid Id { get; set; }
==>
public virtual string Id { get; set; }
And you should be fine
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.