refactor(jpa): 使用 @Column 替换 @Comment 注解
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.lanyuanxiaoyao.service.template.jpa.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.EntityListeners;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.MappedSuperclass;
|
||||
@@ -7,7 +8,6 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
import org.hibernate.annotations.Comment;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
|
||||
/**
|
||||
@@ -43,6 +43,6 @@ public class IdOnlyEntity {
|
||||
*/
|
||||
@Id
|
||||
@SnowflakeId
|
||||
@Comment("记录唯一标记")
|
||||
@Column(comment = "记录唯一标记")
|
||||
private Long id;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lanyuanxiaoyao.service.template.jpa.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.EntityListeners;
|
||||
import jakarta.persistence.MappedSuperclass;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -7,7 +8,6 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.FieldNameConstants;
|
||||
import org.hibernate.annotations.Comment;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.annotation.LastModifiedDate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
@@ -45,7 +45,7 @@ public class SimpleEntity extends IdOnlyEntity {
|
||||
* </p>
|
||||
*/
|
||||
@CreatedDate
|
||||
@Comment("记录创建时间")
|
||||
@Column(comment = "记录创建时间")
|
||||
private LocalDateTime createdTime;
|
||||
|
||||
/**
|
||||
@@ -55,6 +55,6 @@ public class SimpleEntity extends IdOnlyEntity {
|
||||
* </p>
|
||||
*/
|
||||
@LastModifiedDate
|
||||
@Comment("记录更新时间")
|
||||
@Column(comment = "记录更新时间")
|
||||
private LocalDateTime modifiedTime;
|
||||
}
|
||||
Reference in New Issue
Block a user