|
|
@@ -1,8 +1,13 @@
|
|
|
package com.miekir.shibei.bean.db;
|
|
|
|
|
|
+import org.hibernate.annotations.LazyCollection;
|
|
|
+import org.hibernate.annotations.LazyCollectionOption;
|
|
|
+
|
|
|
import javax.persistence.*;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
@@ -104,8 +109,9 @@ public class GoodsBean {
|
|
|
* 烦号信息
|
|
|
*/
|
|
|
@ElementCollection
|
|
|
+ @LazyCollection(LazyCollectionOption.FALSE)
|
|
|
@Column(columnDefinition = "MEDIUMTEXT", name = "fanList", nullable = true, insertable = true, updatable = true)
|
|
|
- public List<String> fanList = new ArrayList<String>();
|
|
|
+ public Set<String> fanList = new HashSet<String>();
|
|
|
|
|
|
/**
|
|
|
* 磁力链接合集
|
|
|
@@ -113,7 +119,7 @@ public class GoodsBean {
|
|
|
//@Column(name = "magnetBeanList", nullable = true, insertable = true, updatable = true)
|
|
|
//对应的是MagnetBean里的变量名goodsBean
|
|
|
@OneToMany(mappedBy="goodsBean", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
|
|
- public List<MagnetBean> magnetBeanList = new ArrayList<MagnetBean>();
|
|
|
+ public Set<MagnetBean> magnetBeanList = new HashSet<MagnetBean>();
|
|
|
|
|
|
/**
|
|
|
* 是否已收藏
|
|
|
@@ -124,10 +130,12 @@ public class GoodsBean {
|
|
|
|
|
|
/**
|
|
|
* 内容的图片链接列表
|
|
|
+ * 需要增加@LazyCollection(LazyCollectionOption.FALSE),否则会报no session or session was closed错误
|
|
|
*/
|
|
|
@ElementCollection
|
|
|
+ @LazyCollection(LazyCollectionOption.FALSE)
|
|
|
@Column(columnDefinition = "MEDIUMTEXT", name = "contentImageUrlList", nullable = true, insertable = true, updatable = true)
|
|
|
- public List<String> contentImageUrlList = new ArrayList<String>();
|
|
|
+ public Set<String> contentImageUrlList = new HashSet<String>();
|
|
|
|
|
|
/**
|
|
|
* 创建时间
|
|
|
@@ -152,7 +160,7 @@ public class GoodsBean {
|
|
|
*/
|
|
|
@Basic
|
|
|
@Column(name = "seeNum", nullable = true, insertable = true, updatable = true)
|
|
|
- public long seeNum;
|
|
|
+ public Long seeNum;
|
|
|
|
|
|
/**是否是本地写死的数据*/
|
|
|
@Basic
|