We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
为作者开源点赞!!以上仅为个人意见
The text was updated successfully, but these errors were encountered:
2.3dev分支版本已加入,通过注解自动更新时间
@Getter @Setter @MappedSuperclass public class BaseEntity implements Serializable { // 删除标识 @Column(name = "is_delete", columnDefinition = "bit default 0") private Boolean isDelete = false; @Column(name = "create_time") @CreationTimestamp private Timestamp createTime; @Column(name = "update_time") @UpdateTimestamp private Timestamp updateTime; public @interface New {} public @interface Update {} @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this); Field[] fields = this.getClass().getDeclaredFields(); try { for (Field f : fields) { f.setAccessible(true); builder.append(f.getName(), f.get(this)).append("\n"); } } catch (Exception e) { builder.append("toString builder encounter an error"); } return builder.toString(); } }
Sorry, something went wrong.
No branches or pull requests
Domain: BaseDomain (id create_time creator update_time updator version等),实体上用@DaTa需谨慎,重写的东西太多,建议Setter Getter
VO/DTO:BaseVo(Dto) 抽取公共属性
Repository: CustomJpaRepository 扩展jpa继承的方法,通过接口+Impl 实现单个接口个性化扩展
如:保存时,save 自动setCreateTime 更新的时候,自动setUpdateTime (通过继承,然后实现save方法实现)
自定义接口+Impl 中可以使用jdbcTemplate等(可以参考JPA文档)
为作者开源点赞!!以上仅为个人意见
The text was updated successfully, but these errors were encountered: