Skip to content
New issue

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

实体类继承基类问题 #1116

Open
Awei-996 opened this issue Oct 23, 2024 · 3 comments
Open

实体类继承基类问题 #1116

Awei-996 opened this issue Oct 23, 2024 · 3 comments

Comments

@Awei-996
Copy link

这里为啥要替换BaseEntity,这样填充属性不就得重新写一遍吗?
public class SysDept extends BaseEntity ==》public class SysDept extends Model
1520

@Awei-996
Copy link
Author

直接在基类上继承不可以吗?

public class BaseEntity<T extends Model<?>> extends Model<T> 

@lltx
Copy link
Collaborator

lltx commented Oct 23, 2024

有代码生成器,这些通用字段不用管, base 实体 controller 这些属于 充血模型, POJO 里面就需要简单一点

@Awei-996
Copy link
Author

有点不太明白,继承Model是为了实现当前实体的一些业务方法,这样就是充血模型是吧。POJO(VO、DTO)这种只专注数据,这种的需要继承BaseEntity是吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants