在底層dao自己添加id=1報錯:java.lang.Long cannot be cast to java.lang.Integerid對應的數(shù)據(jù)庫的id,是不是這里定義為long,數(shù)據(jù)庫的id不能用int啊!不知道如何去排查這個錯誤!還發(fā)現(xiàn):數(shù)據(jù)庫都查詢了DetachableCriteria(CriteriaImpl(com.pdcss.dbzx.survey.entity.SurveyProblems:this[][id=1]))
Hibernate: select this_.id as id1_10_0_, this_.analysis as analysis2_10_0_, this_.answer as answer3_10_0_,
this_.bank_id as bank_id4_10_0_, this_.createtime as createti5_10_0_, this_.img as img6_10_0_,
this_.problem_name as problem_7_10_0_, this_.type as type8_10_0_, this_.typeStr as typeStr9_10_0_ from survey_problems
this_ where this_.id=?但是為什么會報錯?已經(jīng)解決,數(shù)據(jù)庫改成bigint,跟long對應,就ok了!
java.lang.Long cannot be cast to java.lang.Integer
慕運維8079593
2019-03-12 15:15:36