Hi guys!
I currently get the exception in the topic. I still started with NHibernate and my application is still very easy, but I just can't fix the bug. Hopefully you can help me. It's a one-to-one relationship.
Attributs of Geo.cs:
Code:
public class Geo
    {
        private int id;
        private string city;
        private string accessory;
        private Coordinates coordinates;
        private int areaCode;
        private string federalState;
    }
Attributes of Coordinates.cs:
Code:
    {
        private int plc;
        private double longitude;
        private double latitude;
    }
Now the mapping-files...
Geo:
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   assembly="GeoApplication"
                   namespace="GeoApplication.Domain"
                   default-access="property">
  
  <class name="Geo" table="geo_table">
    <id name="Id" column="id" type="Int32">
      <generator class="increment">
        <param name ="property">Coordinates</param>
      </generator>
    </id>
    <property name="City" column="city" length="40" not-null="true"/> <!-- length rein !-->
    <property name="Accessory" column ="accessory" length="40" not-null="false"/>
    <property name="AreaCode" column="area_code" length="8" not-null="false"/>
    <property name="FederalState" column="federal_state" length="30" not-null="true"/>
    <one-to-one name="Coordinates" class="Coordinates"/>
  </class>
Coordinates:
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   assembly="GeoApplication"
                   namespace="GeoApplication.Domain"
                   default-access="property">
  <class name="Coordinates" table="plc_coordinates_table">
    <id name="Plc" column="plc" type="Int32" length="5">
      <generator class="identity"/>
    </id>
    <property name="Longitude" column="longitude"/>
    <property name="Latitude" column="latitude"/>
  </class>
</hibernate-mapping>
The error appears when I commit the transaction.
Has anybody an idea?
Regards, Joey