0
我用彈簧啓動與MySQL春天開機,傑克遜和LOCALDATE的
在我application.properties
spring.jpa.generate-ddl=true
spring.jackson.serialization.write-dates-as-timestamps=false
在我的build.gradle我有
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-data-rest')
compile('org.springframework.boot:spring-boot-starter-web')
compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
在我的java類
import java.time.LocalDate;
@Entity
public class WebSite implements Serializable{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long webSiteId;
private LocalDate date;
...
}
在創建該表,
日期字段創建像TINYBLOB
爲什麼不是日期