Is it OK to use a domain class like the one below to implement UserDetails interface in a Spring Boot with Hibernate? Or is it preferable to use a wrapper class that has a private User instance?
@Entity
@Table(name = "users")
public class User
{
// All fields have setters and getter that aren't included in the code
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "user_id")
private Integer id;
@Column(name = "email")
private String email;
@Column(name = "username")
private String userName;
@Column(name = "password")
@Transient
private String password;
}