jaymz wrote:
The mapping file should look like this:
Quote:
<class name="Address" table="address">
<id name="bid" column="bid">
<generator class="assigned">
</id>
...
<one-to-one name="building" class="Building" constrained="true"/>
</class>
<class name="Building" table="building">
<id name="bid" column="bid">
<generator class="native"/>
</id>
...
</class>
Notice that generator of Address is "assigned", indicate that Address must have the same identifier as Building.
Hey,
I just tried this. But the data I get are nulls. Here is my mappings
<hibernate-mapping>
<class name="org.app.foundation.beans.Gipeda" table="buildings" catalog="buildings_gr">
<id name="gid" type="string">
<column name="id" length="35" />
<generator class="assigned" />
</id>
.............................................
<one-to-one name="map" class="org.app.foundation.beans.GeoMap" constrained="true"/>
</class>
</hibernate-mapping>
and
<hibernate-mapping>
<class name="org.app.foundation.beans.GeoMap" table="maps" catalog="buildings_gr">
<id name="gid" column="gid">
<generator class="native"/>
</id>
<property name="latitude" type="string" not-null="true" />
<property name="longitude" type="string" not-null="true" />
</class>
</hibernate-mapping>
But what I get is null data. Actually a building may not have a geomap (or can have at most one). But i would expect at least the gid of the geomap object to be populated. But I dont get data even for the entries that do have a map associated. Thanks for the help