Asked thg 11 7, 2022 2:09 SA 160 0 1
  • 160 0 1
-2

Cách tương tác dữ liệu từ FE với database

Share
  • 160 0 1

Cho em hỏi có cách nào trong java spring lấy dữ liệu từ database một tên là a nhưng sang FE có thể nhận với tên là b không ạ. Tên khác nhau thôi Ví dụ như trong entity em có @Column(name = "profiledescription") private String profiledescription;

Nhưng FE thì getlist với add lại dùng name khác

1 ANSWERS


Answered thg 11 7, 2022 10:57 SA
Accepted
0

ban co the map sang object khac xong gui di. kieu kieu DAO y

Share
thg 11 8, 2022 8:10 SA

Bạn tham khảo : Jackson

import com.fasterxml.jackson.annotation.JsonProperty;

@Id
@JsonProperty("dish_type_id")
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
0
| Reply
Share
Viblo
Let's register a Viblo Account to get more interesting posts.