jonnybecker wrote:
Hi,
I have a mapping-file like this:
Mapping documents:
<?xml version="1.0"?>
...
<hibernate-mapping>
<class name="de.fhkempten.model.sap.Spfli" table="spfli">
<composite-id name="id" class="de.fhkempten.model.sap.SpfliId">
<key-many-to-one name="scarr" class="de.fhkempten.model.sap.Scarr">
<column name="carrid" length="5" />
</key-many-to-one>
<key-property name="connid" type="string">
<column name="connid" length="5" />
</key-property>
</composite-id>
<property name="airpfrom" type="string">
<column name="airpfrom" length="45" not-null="true" />
</property>
...
<set name="sflights" inverse="true">
<key>
<column name="carrid" length="5" not-null="true" />
<column name="connid" length="5" not-null="true" />
</key>
<one-to-many class="de.fhkempten.model.sap.Sflight" />
</set>
</class>
</hibernate-mapping>
My aim is to access the "scarr" column of this table.
Something like "select spfli.scarr from de.fhkempten.model.sap.Spfli as spfli", throws an error: "could not resolve property: scarr".
Anyone got an idea how I can do this?
Thanks
Jonny
scarr is not a property of spfli, it's a property of spfli.id so I would think you would access it as spfli.id.scarr ?