sqltoy-orm 5.6.87 已经发布,ORM 框架

发布于

sqltoy-orm 5.6.87 已经发布,ORM 框架。

此版本更新内容包括:

1、数据脱敏增加按比例均匀离散分布方式:secureType = SecureType.DISCRETE_RATE

![离散脱敏效果](http://pic.zhso.org/2026/07/28/f675d95d0bad.png)

```java
@Schema(name = "SecureCaseVO", description = "安全加解密演示")
@Data
@Accessors(chain = true)
@SecureConfig(secures = { @Secure(field = "telNoMask", secureType = SecureType.TEL),
@Secure(field = "telNo", secureType = SecureType.ENCRYPT),
@Secure(field = "telNoMask", secureType = SecureType.TEL,sourceField="telNo"),
@Secure(field = "homeAddressMask", secureType = SecureType.DISCRETE_RATE, maskRate = 50, sourceField = "homeAddress"),
@Secure(field = "homeAddress", secureType = SecureType.ENCRYPT) })
@Entity(tableName = "sqltoy_secure_case", comment = "安全加解密演示", pk_constraint = "PRIMARY")
public class SecureCaseVO implements Serializable {

private static final long serialVersionUID = 5349728950824234491L;

@Schema(name = "staffId", description = "工号", nullable = false)
@Id(strategy = "generator", generator = "org.sagacity.sqltoy.plugins.id.impl.DefaultIdGenerator")
@Column(name = "STAFF_ID", comment = "工号", length = 22L, type = java.sql.Types.VARCHAR, nativeType = "VARCHAR", nullable = false)
private String staffId;

@Schema(name = "staffName", description = "姓名", nullable = false)
@Column(name = "STAFF_NAME", comment = "姓名", length = 30L, type = java.sql.Types.VARCHAR, nativeType = "VARCHAR", nullable = false)
private String staffName;

@Schema(name = "telNo", description = "移动电话", nullable = false)
@Column(name = "TEL_NO", comment = "移动电话", length = 500L, type = java.sql.Types.VARCHAR, nativeType = "VARCHAR", nullable = false)
private String telNo;

@Schema(name = "telNoMask", description = "电话检索", nullable = false)
@Column(name = "TEL_NO_MASK", comment = "电话检索", length = 30L, type = java.sql.Types.VARCHAR, nativeType = "VARCHAR", nullable = false)
private String telNoMask;

@Schema(name = "homeAddress", description = "家庭地址", nullable = false)
@Column(name = "HOME_ADDRESS", comment = "家庭地址", length = 500L, type = java.sql.Types.VARCHAR, nativeType = "VARCHAR", nullable = false)
private String homeAddress;

@Schema(name = "homeAddressMask", description = "家庭地址检索", nullable = false)
@Column(name = "HOME_ADDRESS_MASK", comment = "家庭地址检索", length = 100L, type = java.sql.Types.VARCHAR, nativeType = "VARCHAR", nullable = false)
private String homeAddressMask;

@Schema(name = "createBy", description = "创建人", nullable = false)
@Column(name = "CREATE_BY", comment = "创建人", length = 22L, type = java.sql.Types.VARCHAR, nativeType = "VARCHAR", nullable = false)
private String createBy;

@Schema(name = "createTime", description = "创建时间", nullable = false)
@Column(name = "CREATE_TIME", comment = "创建时间", length = 19L, type = java.sql.Types.DATE, nativeType = "DATETIME", nullable = false)
private LocalDateTime createTime;

@Schema(name = "updateBy", description = "最后修改人", nullable = false)
@Column(name = "UPDATE_BY", comment = "最后修改人", length = 22L, type = java.sql.Types.VARCHAR, nativeType = "VARCHAR", nullable = false)
private String updateBy;

@Schema(name = "updateTime", description = "最后修改时间", nullable = false)
@Column(name = "UPDATE_TIME", comment = "最后修改时间", length = 19L, type = java.sql.Types.DATE, nativeType = "DATETIME", nullable = false)
private LocalDateTime updateTime;

public SecureCaseVO() {}

public SecureCaseVO(String staffId) {
this.staffId = staffId;
}
}
```

```xml
<!-- 其他非spring框架可以基于sagacity-sqltoy 进行扩展 -->
<dependency>
<groupId>com.sagframe</groupId>
<artifactId>sagacity-sqltoy</artifactId>
<version>5.6.87</version>
</dependency>

<!-- springboot -->
<dependency>
<groupId>com.sagframe</groupId>
<artifactId>sagacity-sqltoy-spring-starter</artifactId>
<version>5.6.87</version>
</dependency>

<!-- solon 插件 -->
<dependency>
<groupId>com.sagframe</groupId>
<artifactId>sagacity-sqltoy-solon-plugin</artifactId>
<version>5.6.87</version>
</dependency>
```

详情查看:[https://gitee.com/sagacity/sagacity-sqltoy/releases/5.6.87](https://gitee.com/sagacity/sagacity-sqltoy/releases/5.6.87)

---

原文链接:[点击查看](https://www.oschina.net/news/481399)

评论

暂无评论。

0.033785s