Integer類型不行,哪怕是在用上面這行代碼之前將id轉換為String類型也不行。報500錯誤:Provided id of the wrong type for class com.imooc.girl.bean.Girl. Expected: class java.lang.Integer, got class java.lang.String; nested exception is java.lang.IllegalArgumentException: Provided id of the wrong type for class com.imooc.girl.bean.Girl. Expected: class java.lang.Integer, got class java.lang.String
2018-10-25
2018-08-03
為什么改成這個還不好用
Integer類型不行,哪怕是在用上面這行代碼之前將id轉換為String類型也不行。報500錯誤:Provided id of the wrong type for class com.imooc.girl.bean.Girl. Expected: class java.lang.Integer, got class java.lang.String; nested exception is java.lang.IllegalArgumentException: Provided id of the wrong type for class com.imooc.girl.bean.Girl. Expected: class java.lang.Integer, got class java.lang.String
而當我把主鍵改為String才好使。
其次,如果主鍵改為String后,還可以在實體類上面添加注解
2018-07-28
可能以前的版本方法被搞了,findById是可以的,不想加orElse的話自己在自己那個接口上重寫覆蓋,很多方法的返回類型很懵或出啥子問題可以多嘗試自己擴展。
2018-07-18
2018-07-18
2018-07-18
同樣的問題??!