Hi, I'm having trouble to persist a Map<Integer, Non-Entity> :
The key of the map is just some integer value
Rgb:
Code:
public class RGB {
private int red;
private int green;
private int blue;
public RGB() {}
...
DeviceType:
Code:
public class DeviceTypeDao implements Serializable {
private long id;
private String name;
private String description;
private double angle;
// TODO
private Map<Integer,RGB> channelToRgb;
private double intensity;
private int xAxis;
private int yAxis;
private int zAxis;
private boolean fog;
public DeviceTypeDao() {}
...
xml-Mapping:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>
<class name="com.schmit.marco.DeviceTypeDao">
<id name="id">
<generator class="increment"/>
</id>
<property name="name" type="string"/>
<property name="description" type="string"/>
<property name="angle" type="double"/>
<property name="intensity" type="double"/>
<property name="xAxis" type="integer"/>
<property name="yAxis" type="integer"/>
<property name="zAxis" type="integer"/>
<property name="fog" type="boolean"/>
<map name="channelToRgb" cascade="all">
<key column="deviceTypeId"/>
<index column="channelNumber" type="integer"/>
// RGB?? ##############################
</map>
</class>
</hibernate-mapping>
Would be great if some could tell me how to get this working!