How to map an ArrayList of primitives to a single column?

前端 未结 4 2073
没有蜡笔的小新
没有蜡笔的小新 2020-12-31 11:02

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

4条回答
  •  抹茶落季
    2020-12-31 11:44

    You can implement your own custom type as an array:

    http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/types.html#types-custom

    Also, it is not that hard to find some implementations, some of them going as far to let you compare those arrays in a HQL where clause.

    https://forum.hibernate.org/viewtopic.php?t=946973

    I personally never thought i would try something like this. But now I am very curious.

提交回复
热议问题