My guess is it would be right here:
> .SetAttribute("srid", "4326")
.SetAttribute("subtype", "POLYGON");
I believe FNH will set that attribute on the type or property element, not
as sub-parameter elements.. Also, the SetAttribute() method should have been
phased out during release 1.0. What version of FNH are you running?
I don't know if we've got support for the <param/> tag inside of Type, but
I'd imagine that's what you're looking for. Try downloading the newest
version of FNH and seeing if the Param option is available to you whenever
you specify a type.
On Mon, Dec 14, 2009 at 2:53 AM, James Allen <
[email protected]> wrote:
> Hi,
>
> I'm trying to use the NHibernate.Spatial beta from NhContrib, and it
> seems I need an attribute called SRID set on an entity. This is an
> example from the tests in the source code:
>
> <class name="Tests.NHibernate.Spatial.Model.County,
> Tests.NHibernate.Spatial" table="county">
> <id name="Id" type="Int64" column="oid" >
> <generator class="native" />
> </id>
> <property name="Name"/>
> <property name="State" />
> <property name="Boundaries" column="the_geom">
> <type
> name="NHibernate.Spatial.Type.GeometryType,NHibernate.Spatial">
> <param name="srid">32719</param>
> <param name="subtype">POLYGON</param>
> </type>
> </property>
> </class>
>
> This is what I have come up with as the equuivalent in fluent:
>
> public AreaMapping()
> {
> Id(c => c.Id).GeneratedBy.Native();
> Map(c => c.Name).Not.Nullable();
> Map(c => c.State).Not.Nullable();
>
> Map(x => x.Boundaries)
> .CustomTypeIs<MsSql2008GeometryType>()
> .CustomSqlTypeIs("GEOGRAPHY")
> .SetAttribute("srid", "4326")
> .SetAttribute("subtype", "POLYGON");
> }
>
> However I get an exception during runtime:
>
> XML validation error: The 'SRID' attribute is not declared.
> Message: The 'SRID' attribute is not declared.
>
> Anyone know what i am missing? Could it be that I need to upgrade my
> NHibernate version 2.1.0 to the latest 2.1.2? I am using the MsSql2008
> dialect.
>
> Thanks
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Fluent NHibernate" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<fluent-nhibernate%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/fluent-nhibernate?hl=en.
>
>
>
--
- Hudson
http://www.bestguesstheory.com
http://twitter.com/HudsonAkridge
--
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" 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/fluent-nhibernate?hl=en.