Saving order of a List in JPA

前端 未结 3 1397
粉色の甜心
粉色の甜心 2021-02-01 03:45

I have the following question about JPA:

Can I save the order of the elements in a java.util.List? In my application the order in which I put elements in the Lists is im

3条回答
  •  后悔当初
    2021-02-01 04:15

    There are some hacky ways of doing this in JPA 1, but it's easiest to switch to a JPA 2 provider. The @OrderColumn annotation support is what you're looking for. Eclipselink have an ok tutorial on how to use it.

提交回复
热议问题