The Spatial Extensions are for NH 2.1.2 and apparently haven't been
updated since 2008. I got simple Spatial stuff working with NH 3 using
the SqlGeometryType from the Spatial Extensions, modifying
NHibernate.Type.TypeFactory.RegisterType to make it public, and
registered SqlGeometry as follows:

    NHibernate.Type.TypeFactory.RegisterType(typeof(SqlGeometry),
SqlGeometryType.Default, new string[] { "geometry" });

And I map my geometry column as follows:

    Map(e => e.Location)
        .CustomSqlType("geometry")
        ;

So ... I'm wondering if there's a way to register a UDT without making
changes to the NH core? This is an incredibly easy way of getting
*basic* CRUD spatial support - and I can at least use CreateSQLQuery
to do spatial queries when I need to, but I'd rather not mess with the
NH core if I don't have to.

I just started using NH (the workarounds to get spatial data working
with Entity Framework 4 is a total PITA - this is much more elegant)

-- 
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.

Reply via email to