ruanwenjun commented on a change in pull request #5651:
URL: https://github.com/apache/dolphinscheduler/pull/5651#discussion_r664978279
##########
File path:
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Resource.java
##########
@@ -68,10 +68,15 @@
*/
private int userId;
- /**
- * resource type
- */
- private ResourceType type;
+ /**
+ * user Name
+ */
+ private String userName;
Review comment:
@kyoty I think you should separate the datasource entity from the
front-end return entity. If you represent it in one class, you might meet the
below problems.
1. If you need to change the paremeters that the front-end needs(the current
case), you need to modify this class.
2. if the table in the database change, you also need to modify this class.
3. If you want to remove some parameters returned to the front-end, you
might also add @JsonIgnore in this class.
Over time, the class will become more and more complex, it's difficult to
know the actual definition in the database.
The recommendation is to use a separate entity(DO) to represent the table
object in the database, and convert him into DTO and return to the front end.
DTO may have richer attributes.
But if you do this, you may not be able to use `join` in sql(`join` is not a
good way).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]