sqltoy-orm 5.6.88 已经发布,ORM 框架
sqltoy-orm 5.6.88 已经发布,这是一个 ORM 框架。
此版本更新内容包括:
1. **调整 PostgreSQL 方案定义**:
- 将原本 `Dialect.POSTGRESQL15(>=15)` 和 `Dialect.POSTGRESQL(<15)` 方言定义方式调整为 `Dialect.POSTGRESQL(>=15)`,新增 `Dialect.POSTGRESQL14(<15)`,应对 pg14 版本逐步淘汰而更高版本 pg 成为常态的场景。
2. **升级 fastjson 2.0.83 版本依赖**。
3. **数据脱敏**增加按比例均匀离散分布方式:`secureType = SecureType.DISCRETE_RATE` 
```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;
/** default constructor */
public SecureCaseVO() {
}
/** pk constructor */
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.88)
---
原文链接:[点击查看](https://www.oschina.net/news/483029)
此版本更新内容包括:
1. **调整 PostgreSQL 方案定义**:
- 将原本 `Dialect.POSTGRESQL15(>=15)` 和 `Dialect.POSTGRESQL(<15)` 方言定义方式调整为 `Dialect.POSTGRESQL(>=15)`,新增 `Dialect.POSTGRESQL14(<15)`,应对 pg14 版本逐步淘汰而更高版本 pg 成为常态的场景。
2. **升级 fastjson 2.0.83 版本依赖**。
3. **数据脱敏**增加按比例均匀离散分布方式:`secureType = SecureType.DISCRETE_RATE` 
```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;
/** default constructor */
public SecureCaseVO() {
}
/** pk constructor */
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.88)
---
原文链接:[点击查看](https://www.oschina.net/news/483029)
评论
暂无评论。