Closed tongtian100 closed 2 hours ago
3.5.9
LocalDateTime类型可以填充 Long类型无法填充 bug示例:https://github.com/tongtian100/my-bug 代码
@Component public class MyMetaObjectHandler implements MetaObjectHandler { @Override public void insertFill(MetaObject metaObject) { // log.info("开始插入填充..."); this.strictInsertFill(metaObject, "createdTime", LocalDateTime.class, LocalDateTime.now()); this.strictUpdateFill(metaObject, "updatedTime", LocalDateTime.class, LocalDateTime.now()); //无法填充 this.strictUpdateFill(metaObject, "createdBy", Long.class, 1L); }
实体类
@Data @Accessors(chain = true) public class BaseEntity implements Serializable { @Serial private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; @TableField(fill = FieldFill.INSERT) private LocalDateTime createdTime; @TableField(fill = FieldFill.INSERT_UPDATE) private LocalDateTime updatedTime; private LocalDateTime deletedTime; @TableLogic private Boolean deleted; @TableField(fill = FieldFill.INSERT) private Long createdBy; @TableField(fill = FieldFill.INSERT_UPDATE) private Long updatedBy; @Version private Long version; }
user实体类
@Data @Accessors(chain = true) @EqualsAndHashCode(callSuper = true) @TableName("user") public class UserEntity extends BaseEntity { private String username; private String passwordHash; private String email; private String firstName; private String lastName; private String phoneNumber; private LocalDate dateOfBirth; private String gender; private String address; private String city; private String state; private String country; private String postalCode; private LocalDateTime lastLogin; private Boolean isActive; private Boolean isStaff; private String profilePicture; }
No response
update不在insert时填充
确认
当前程序版本
3.5.9
问题描述
LocalDateTime类型可以填充 Long类型无法填充 bug示例:https://github.com/tongtian100/my-bug 代码
实体类
user实体类
详细堆栈日志
No response