I've a User
entity.
public class User {
private String username;
private String password;
private String firstname;
private String lastname;
/* Other user attributes */
/* Getters and Setters */
}r
I need to send this user to view layer to display user info but I don't want password
field to be sent to view layer for security concerns.
Currenlty, I am not using DTOs.
How can I omit password
field while retrieving User
entity from database?
Basically, how can I filter password
field from User
entity while sending to view layer?
My application is built with spring-data-jpa
and spring-mvc
.