Persisting LinkedList in Hibernate

后端 未结 2 1330
温柔的废话
温柔的废话 2021-01-07 02:28

I am trying to persist a Class with a LinkedList Attribute but can\'t seem to get it right. Here is my code and my mapping:

 import java.util.LinkedList;
 pu         


        
2条回答
  •  一生所求
    2021-01-07 03:08

    Generally, Hibernate will provide its own implementations for collections so you should prefer interfaces to specific implementations. It's probably attempting to assign a different kind of list to images and failing. You would have to change your field to List.

提交回复
热议问题