Home > Java > javaTutorial > body text

Spring MVC+Fastjson time type serialization

怪我咯
Release: 2017-06-23 11:53:04
Original
1579 people have browsed it

Time type serialization:

Note the red code, the JSONField class of fastjson must be introduced, not others.

import com.alibaba.fastjson.annotation.JSONField;@Entity
@Table(name="User")public class User{
  @Id
  @Column(name = "id")
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;
  @JSONField (format="yyyy-MM-dd HH:mm:ss")  
  public Date createTime; 
}
Copy after login

The above is the detailed content of Spring MVC+Fastjson time type serialization. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!