-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Persist Map<Integer, Non-Entity>
PostPosted: Wed Nov 28, 2012 9:36 am 
Newbie

Joined: Wed Nov 28, 2012 6:16 am
Posts: 4
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!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.