Refactor Option entity

pull/137/head
ruibaby 2019-03-22 17:15:17 +08:00
parent cd3a5845fa
commit 3100c9eb29
9 changed files with 9 additions and 21 deletions

View File

@ -1,6 +1,5 @@
package cc.ryanc.halo.model.entity;
import cc.ryanc.halo.utils.DateUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ -8,7 +7,6 @@ import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import javax.persistence.*;
import java.util.Date;
/**
* Category entity.

View File

@ -1,7 +1,6 @@
package cc.ryanc.halo.model.entity;
import cc.ryanc.halo.model.enums.CommentStatus;
import cc.ryanc.halo.utils.DateUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ -9,7 +8,6 @@ import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import javax.persistence.*;
import java.util.Date;
/**
* Comment entity.

View File

@ -1,6 +1,5 @@
package cc.ryanc.halo.model.entity;
import cc.ryanc.halo.utils.DateUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

View File

@ -1,6 +1,5 @@
package cc.ryanc.halo.model.entity;
import cc.ryanc.halo.utils.DateUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ -8,7 +7,6 @@ import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import javax.persistence.*;
import java.util.Date;
/**
* Link entity

View File

@ -2,7 +2,6 @@ package cc.ryanc.halo.model.entity;
import cc.ryanc.halo.model.enums.LogType;
import cc.ryanc.halo.utils.DateUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ -10,7 +9,6 @@ import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import javax.persistence.*;
import java.util.Date;
/**
* Log entity.

View File

@ -1,6 +1,5 @@
package cc.ryanc.halo.model.entity;
import cc.ryanc.halo.utils.DateUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ -8,7 +7,6 @@ import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import javax.persistence.*;
import java.util.Date;
/**
* Menu entity

View File

@ -1,6 +1,5 @@
package cc.ryanc.halo.model.entity;
import cc.ryanc.halo.utils.DateUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ -8,7 +7,6 @@ import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import javax.persistence.*;
import java.util.Date;
/**
* Setting entity.
@ -29,20 +27,27 @@ public class Option extends BaseEntity {
private Integer id;
/**
* Key
* option key
*/
@Column(name = "option_key", columnDefinition = "varchar(100) not null")
private String optionKey;
/**
* Value
* option value
*/
@Column(name = "option_value", columnDefinition = "varchar(1023) not null")
private String optionValue;
/**
* source,default is system
*/
@Column(name = "source", columnDefinition = "varchar(127) default 'system'")
private String source;
@Override
public void prePersist() {
super.prePersist();
id = null;
source = "system";
}
}

View File

@ -1,14 +1,11 @@
package cc.ryanc.halo.model.entity;
import cc.ryanc.halo.utils.DateUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import javax.persistence.*;
import java.util.Date;
import java.util.Objects;
/**

View File

@ -5,11 +5,8 @@ import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import javax.persistence.*;
import java.util.Date;
/**
* Tag entity