Replace SomeSpatialDialect by the spatial dialect to be used (eg. MsSql2008SpatialDialect.) and SomeSpatialAssembly by the assembly name where it is located (eg. NHibernate.Spatial.MsSql2008)
ActiveRecord Schema Generation Configuration:
You will need to add the SpatialAuxiliaryDatabaseObject in the Application_OnStart:
You can then generate the database schema in the usual way.
There are two classes available for metadata mapping in the NHibernate.Spatial.Metadata namespace: GeometryColumn and SpatialReferenceSystem. You can add them selectively:
Then you can use them as normal mapped classes. For example, you could execute the following HQL query:
WARNING: DO NOT add metadata class mappings when using the SchemaExport utility. You could lose all contents of metadata tables.
NOTE: Type parameters (see NHibernate mapping above) are not supported in ActiveRecord.
ActiveWriter is a tool to visually model entities and relationships, and generate ActiveRecord classes or NHibernate mapping files. Since Preview 3, it supports custom types, so we can use the GeometryType / IGeometry pair..
NOTE: Type parameters (see NHibernate mapping above) are not supported in ActiveRecord, so it is in ActiveWriter.