com.github.dreamroute.basic.bdfint.domain.BaseDomain Maven / Gradle / Ivy
package com.github.dreamroute.basic.bdfint.domain;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
* @author w.dehai
*
*
Description: 基础实体类,几乎所有实力均需要继承自此
*
对lombok注解的说明:
*
* - @Data = {@Getter, @Setter, toString}
*
- @EqualsAndHashCode(onlyExplicitlyIncluded = true)表名只针对@EqualsAndHashCode.Include标记的字段生效
*
- 在id字段上标记@EqualsAndHashCode.Include,表示实体对象的equals方法和hashCode方法只与主键id相关,与其他字段无关
*
- 业务实体需要继此类
*
- 业务实体需要如下使用注解(定义实体时请复制下列注解),参考(Demo.java)生成的equals和hashCode方法才只与id相关
*
* @Data
* @SuperBuilder
* @NoArgsConstructor
* @AllArgsConstructor
* @Table(name = "表名")
* @EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true)
*
*
*
*/
@SuperBuilder
@NoArgsConstructor
public class BaseDomain extends MetaInfo {}