Authored by liangyi.chen@yoho.cn

Fix

@@ -5,18 +5,24 @@ import com.yoho.datasync.core.base.annotation.FieldTransfer; @@ -5,18 +5,24 @@ import com.yoho.datasync.core.base.annotation.FieldTransfer;
5 import com.yoho.datasync.core.base.model.yh_pcms.PublicArticle; 5 import com.yoho.datasync.core.base.model.yh_pcms.PublicArticle;
6 import lombok.Data; 6 import lombok.Data;
7 7
  8 +import javax.persistence.*;
  9 +
8 /*** 10 /***
9 * 种草社区表 <--> 公共库表 11 * 种草社区表 <--> 公共库表
10 * @author peuei 12 * @author peuei
11 * @date 2019/3/19 10:37 13 * @date 2019/3/19 10:37
12 * @description 对应表 yh_grass.grass_article 14 * @description 对应表 yh_grass.grass_article
13 */ 15 */
  16 +@Entity
14 @Data 17 @Data
15 @ClassTransfer(targetClass = PublicArticle.class) 18 @ClassTransfer(targetClass = PublicArticle.class)
16 public class GrassArticle { 19 public class GrassArticle {
17 20
18 // 将原主键保存到目标对象 21 // 将原主键保存到目标对象
19 @FieldTransfer(targetFieldName = "relateId") 22 @FieldTransfer(targetFieldName = "relateId")
  23 + @Id
  24 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  25 + @Column(name = "id", nullable = false, unique = true)
20 private Integer id; 26 private Integer id;
21 27
22 @FieldTransfer 28 @FieldTransfer