Hi!
Can anyone explain me or post here an example code of a .hbm.xml file that maps a table view from a DB table, plz? It would be quite helpful. Thank you!
P.S: I have created one with Hibernate Tools and I got a mapping file the looks like this. (I don't like the idea of all fields being a composite-id...is it possible to be just simple properties so I can select by criteria?)
Code:
<hibernate-mapping>
<class name="persistenceLayer.ListSensors" table="list_sensors" catalog="kobas_maintenance">
<composite-id name="id" class="persistenceLayer.ListSensorsId">
<key-property name="sensorId" type="string">
<column name="SensorID" length="20" />
</key-property>
<key-property name="name" type="string">
<column name="Name" length="20" />
</key-property>
<key-property name="zeroScale" type="double">
<column name="ZeroScale" precision="22" scale="0" />
</key-property>
<key-property name="fullScale" type="double">
<column name="FullScale" precision="22" scale="0" />
</key-property>
<key-property name="physicalZs" type="double">
<column name="PhysicalZS" precision="22" scale="0" />
</key-property>
<key-property name="physicalFs" type="double">
<column name="PhysicalFS" precision="22" scale="0" />
</key-property>
</composite-id>
</class>
</hibernate-mapping>