I have a problem with @GetMapping
in Spring boot.
It's about my @GetMapping
function that doesn't serialize my id
on this model while getting all data from database:
//User.java
@Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(name = "username")
private String username;
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "joined_date")
@CreatedDate
private Date joinedDate;
@Column(name = "password")
private String password;
@Column(name = "bio")
private String bio;
@Column(name = "email")
private String email;
}
I tried many ways but cannot solve at all. Even this question: Spring boot @ResponseBody doesn't serialize entity id
This is the image below: