大佬門, 我mongodb中一個欄位是存盤的字串,對應的物體類中是存盤的date,用的spring-data-mongodb,怎么將這個欄位轉換后映射上?
如果我不做任何處理的話,會報:Caused by: org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.util.Date] for value '2002-07-01';
使用注解@dateTimeFormat也沒用
使用轉換器的話會嘗試把所有string都轉換成date,肯定也不行,是我使用姿勢不對么?
大佬們,咋辦啊
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/195665.html
標籤:新技術前沿
下一篇:mysql分組函式與查詢
