From e34f87b01c1333a9b5f76788d36d50e260880403 Mon Sep 17 00:00:00 2001 From: chuyan <1047381936@qq.com> Date: Fri, 14 Feb 2020 17:15:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=AD=90=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../codesdream/ase/model/activity/Activity.java | 15 +++------------ .../com/codesdream/ase/model/activity/Report.java | 7 +------ src/main/resources/application.properties | 2 +- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/codesdream/ase/model/activity/Activity.java b/src/main/java/com/codesdream/ase/model/activity/Activity.java index a000984..85e2173 100644 --- a/src/main/java/com/codesdream/ase/model/activity/Activity.java +++ b/src/main/java/com/codesdream/ase/model/activity/Activity.java @@ -2,10 +2,6 @@ package com.codesdream.ase.model.activity; import com.codesdream.ase.model.permission.User; import lombok.Data; -import org.dom4j.QName; -import org.hibernate.annotations.CollectionId; -import org.hibernate.annotations.WhereJoinTable; -import org.springframework.context.annotation.EnableMBeanExport; import javax.persistence.*; import java.util.Date; @@ -14,23 +10,18 @@ import java.util.Set; @Data @Entity -@Table(name = "activity", - indexes = { - @Index(name = "act_index1", columnList = "title", unique = true), - @Index(name = "act_index2", columnList = "creator") - } -) +@Table(name = "activity") public class Activity { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; //活动标题 - @Column(nullable = false, unique = true) + @Column(name = "title", nullable = false, unique = true) private String title; //创建人 - @Column(nullable = false) + @Column(name = "creator", nullable = false) private String creator; //活动类型 diff --git a/src/main/java/com/codesdream/ase/model/activity/Report.java b/src/main/java/com/codesdream/ase/model/activity/Report.java index dbeaf37..12f0e56 100644 --- a/src/main/java/com/codesdream/ase/model/activity/Report.java +++ b/src/main/java/com/codesdream/ase/model/activity/Report.java @@ -11,12 +11,7 @@ import java.util.Set; @Data @Entity -@Table(name = "report", - indexes = { - @Index(name = "report_index1", columnList = "title"), - @Index(name = "report_index2", columnList = "creator") - } -) +@Table(name = "report") public class Report { @Id diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index e33dd03..f04afda 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -7,7 +7,7 @@ spring.thymeleaf.encoding=UTF-8 spring.jpa.generate-ddl=false spring.jpa.show-sql=true -spring.jpa.hibernate.ddl-auto=update +spring.jpa.hibernate.ddl-auto=create spring.jooq.sql-dialect=org.hibernate.dialect.MySQL5InnoDBDialect spring.jpa.open-in-view=true spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true