You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.5 KiB
43 lines
1.5 KiB
package com.entity.view;
|
|
|
|
import com.entity.BumenfenleiEntity;
|
|
|
|
import com.baomidou.mybatisplus.annotations.TableName;
|
|
import org.apache.commons.beanutils.BeanUtils;
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
|
import java.io.Serializable;
|
|
|
|
//部门分类
|
|
// 后端返回视图实体辅助类
|
|
// (通常后端关联的表或者自定义的字段需要返回使用)
|
|
// @author
|
|
// @email
|
|
// @date 2021-04-24 15:19:31
|
|
|
|
@TableName("bumenfenlei")
|
|
public class BumenfenleiView extends BumenfenleiEntity implements Serializable {
|
|
// 序列化版本号,用于保证序列化和反序列化过程中类的版本一致性
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
// 无参构造函数,用于创建一个空的 BumenfenleiView 对象
|
|
|
|
public BumenfenleiView() {
|
|
}
|
|
|
|
// 有参构造函数,用于根据 BumenfenleiEntity 对象创建 BumenfenleiView 对象
|
|
// @param bumenfenleiEntity 部门分类实体对象
|
|
|
|
public BumenfenleiView(BumenfenleiEntity bumenfenleiEntity) {
|
|
try {
|
|
// 使用 BeanUtils.copyProperties 方法将 bumenfenleiEntity 的属性复制到当前对象
|
|
// 这样可以方便地将 BumenfenleiEntity 对象的属性值传递给 BumenfenleiView 对象
|
|
BeanUtils.copyProperties(this, bumenfenleiEntity);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
// 当复制属性过程中出现非法访问异常或者调用目标方法异常时,打印异常堆栈信息
|
|
// 这里需要根据实际情况进行更完善的异常处理,例如记录日志等
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|