Ok, I have changed the mapping to look like the following
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping package="de.gloegl.road2hibernate">
<class name="Port" table="fromto">
<id name="id" column="id" type="java.lang.String" unsaved-value="null" length="32">
<generator class="increment"/>
</id>
<property name="abbreviation" column="originID" not-null="true"/>
<property name="name" column="origin" not-null="true"/>
<many-to-one name="origin" class="Port" column="originID" insert="false" update="false" cascade="none" not-null="false"/>
<set name="destinations" table="fromto" cascade="all" inverse="true" lazy="false">
<key column="destinationID"/>
<one-to-many class="Port"/>
</set>
</class>
</hibernate-mapping>
I can see the query from the log executing correctly
Code:
select port0_.id as id, port0_.originID as originID, port0_.origin as origin from fromto port0_ where (destinationID!='~~~' )
and calling size in the results List, comes up with the correct number, but when looking inside the results List, all elements are 'null' therefore getting a NPE.
Any help much appreciated...