提交 ab84b48a 作者: 方治民

feat: 更新 deleted 标记字段实现相关

上级 616c3731
......@@ -17,7 +17,6 @@ import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
/**
* 权限
......@@ -28,20 +27,18 @@ import org.hibernate.annotations.Where;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@SuperBuilder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults(level = AccessLevel.PRIVATE)
@SQLDelete(sql = DELETE_SQL)
@SQLDelete(sql = DELETE_SQL + BasicEntity.Where.WHERE_ID)
@SQLDeleteAll(sql = DELETE_SQL)
@Where(clause = BasicEntity.Where.EXIST)
@Entity
@Table(
name = TABLE_NAME,
indexes = {
@Index(columnList = BasicEntity.Fields.deleteTime),
@Index(columnList = BasicEntity.Fields.deleted),
@Index(columnList = Permission.Fields.type),
@Index(columnList = Permission.Fields.pid),
@Index(columnList = Permission.Fields.tree),
......
/* (C) 2022 YiRing, Inc. */
package com.yiring.auth.domain.role;
import static com.yiring.auth.domain.role.Role.DELETE_SQL;
import static com.yiring.auth.domain.role.Role.TABLE_NAME;
import com.fasterxml.jackson.annotation.JsonIgnore;
......@@ -31,20 +30,19 @@ import org.hibernate.annotations.Where;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@SuperBuilder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults(level = AccessLevel.PRIVATE)
@SQLDelete(sql = DELETE_SQL)
@SQLDeleteAll(sql = DELETE_SQL)
@SQLDelete(sql = Permission.DELETE_SQL + BasicEntity.Where.WHERE_ID)
@SQLDeleteAll(sql = Permission.DELETE_SQL)
@Where(clause = BasicEntity.Where.EXIST)
@Entity
@Table(
name = TABLE_NAME,
indexes = @Index(columnList = BasicEntity.Fields.deleteTime),
uniqueConstraints = { @UniqueConstraint(columnNames = { Role.Fields.uid, BasicEntity.Fields.deleteTime }) }
indexes = @Index(columnList = BasicEntity.Fields.deleted),
uniqueConstraints = { @UniqueConstraint(columnNames = { Role.Fields.uid, BasicEntity.Fields.deleted }) }
)
@Comment("系统角色")
public class Role extends BasicEntity implements Serializable {
......
......@@ -2,6 +2,7 @@
package com.yiring.auth.domain.user;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yiring.auth.domain.permission.Permission;
import com.yiring.auth.domain.role.Role;
import com.yiring.common.domain.BasicEntity;
import jakarta.persistence.*;
......@@ -17,7 +18,6 @@ import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
/**
* 用户
......@@ -28,23 +28,21 @@ import org.hibernate.annotations.Where;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@SuperBuilder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults(level = AccessLevel.PRIVATE)
@SQLDelete(sql = User.DELETE_SQL)
@SQLDeleteAll(sql = User.DELETE_SQL)
@Where(clause = User.Where.EXIST)
@SQLDelete(sql = Permission.DELETE_SQL + BasicEntity.Where.WHERE_ID)
@SQLDeleteAll(sql = Permission.DELETE_SQL)
@Entity
@Table(
name = User.TABLE_NAME,
indexes = { @Index(columnList = User.Fields.enabled), @Index(columnList = BasicEntity.Fields.deleteTime) },
indexes = { @Index(columnList = User.Fields.enabled), @Index(columnList = BasicEntity.Fields.deleted) },
uniqueConstraints = {
@UniqueConstraint(columnNames = { User.Fields.username, BasicEntity.Fields.deleteTime }),
@UniqueConstraint(columnNames = { User.Fields.mobile, BasicEntity.Fields.deleteTime }),
@UniqueConstraint(columnNames = { User.Fields.email, BasicEntity.Fields.deleteTime }),
@UniqueConstraint(columnNames = { User.Fields.username, BasicEntity.Fields.deleted }),
@UniqueConstraint(columnNames = { User.Fields.mobile, BasicEntity.Fields.deleted }),
@UniqueConstraint(columnNames = { User.Fields.email, BasicEntity.Fields.deleted }),
}
)
@Comment("系统用户")
......
......@@ -18,7 +18,6 @@ import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
/**
* 分类字典
......@@ -30,20 +29,18 @@ import org.hibernate.annotations.Where;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@SuperBuilder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults(level = AccessLevel.PRIVATE)
@SQLDelete(sql = DELETE_SQL)
@SQLDelete(sql = DELETE_SQL + BasicEntity.Where.WHERE_ID)
@SQLDeleteAll(sql = DELETE_SQL)
@Where(clause = BasicEntity.Where.EXIST)
@Entity
@Table(
name = TABLE_NAME,
indexes = {
@Index(columnList = BasicEntity.Fields.deleteTime),
@Index(columnList = BasicEntity.Fields.deleted),
@Index(columnList = Category.Fields.name),
@Index(columnList = Category.Fields.code),
}
......
/* (C) 2023 YiRing, Inc. */
package com.yiring.dict.domain;
import static com.yiring.dict.domain.Dict.DELETE_SQL;
import static com.yiring.dict.domain.Dict.TABLE_NAME;
import com.fasterxml.jackson.annotation.JsonIgnore;
......@@ -18,7 +17,6 @@ import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
/**
* 字典
......@@ -30,20 +28,18 @@ import org.hibernate.annotations.Where;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@SuperBuilder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults(level = AccessLevel.PRIVATE)
@SQLDelete(sql = DELETE_SQL)
@SQLDeleteAll(sql = DELETE_SQL)
@Where(clause = BasicEntity.Where.EXIST)
@SQLDelete(sql = Category.DELETE_SQL + BasicEntity.Where.WHERE_ID)
@SQLDeleteAll(sql = Category.DELETE_SQL)
@Entity
@Table(
name = TABLE_NAME,
indexes = {
@Index(columnList = BasicEntity.Fields.deleteTime),
@Index(columnList = BasicEntity.Fields.deleted),
@Index(columnList = Dict.Fields.name),
@Index(columnList = Dict.Fields.code),
}
......
/* (C) 2023 YiRing, Inc. */
package com.yiring.dict.domain;
import static com.yiring.dict.domain.DictItem.DELETE_SQL;
import static com.yiring.common.domain.BasicEntity.Where.WHERE_ID;
import static com.yiring.dict.domain.DictItem.TABLE_NAME;
import com.yiring.common.domain.BasicEntity;
......@@ -15,7 +15,6 @@ import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
/**
* 字典选项
......@@ -27,20 +26,18 @@ import org.hibernate.annotations.Where;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@SuperBuilder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults(level = AccessLevel.PRIVATE)
@SQLDelete(sql = DELETE_SQL)
@SQLDeleteAll(sql = DELETE_SQL)
@Where(clause = BasicEntity.Where.EXIST)
@SQLDelete(sql = Category.DELETE_SQL + WHERE_ID)
@SQLDeleteAll(sql = Category.DELETE_SQL)
@Entity
@Table(
name = TABLE_NAME,
indexes = {
@Index(columnList = BasicEntity.Fields.deleteTime),
@Index(columnList = BasicEntity.Fields.deleted),
@Index(columnList = DictItem.Fields.name),
@Index(columnList = DictItem.Fields.enable),
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论