Hi,
I'm using Hibernate 3.2 with annotations.
I'd like to persist an array of double (the primitive type) inside the same table as the whole class, just like a component would be.
I'd like to do that because my array has only just six elements, so I think it would be faster to fetch if it lies inside the same table as the class it belongs to, rather than a separate one.
Unfortunately I don't know if Hibernate can do that.
Here's my snippet of code representing what I'm trying to accomplish :
Code:
@Entity
@Table(name="RATES")
public class Rate {
private Long id;
//Other fields declarations
private static final int VOLUME_COUNT = 6;
private double[] rates = new double[VOLUME_COUNT];
//Constructors and getters,setters with Hibernate annotations
private double[] getRates() {...}
//...
}
So, is it possible to persist an array the way I'd like to, or should I use another table to store it ?
Thanks in advance.