Let\'s say I have the following situation:
Object Car has an ArrayList of prices, which are all numbers. Is it possible in Hibernate to save all the prices in a sin
AFAIR, Hibernate will use native serialization and store the resulting bytes in your column. I wouldn't do that though, and use a dedicated transformation that would make the prices readable in the database, and at least be able to use the data without needing Java native serialization:
@Basic
private String prices;
public void setPrices(List prices) {
this.prices = Joiner.on(',').join(prices);
}
public List getPrices() {
List result = new ArrayList();
for (String s : Splitter.on(',').split(this.prices)) {
result.add(Integer.valueOf(s));
}
return result;
}