pojo中枚举字段,对应的数据库中表的字段值为空,报错如下:
Caused by: java.lang.RuntimeException: Fail to set ''[ ] by setter com.*****.core.team.pojo.Team.'setAdminLevel()' because [java.lang.IllegalArgumentException: No enum constant com.*******.core.team.enums.AdminLevel.]: No enum constant com.******.core.team.enums.AdminLevel.
at org.nutz.lang.Lang.wrapThrow(Lang.java:164)
at org.nutz.lang.inject.InjectBySetter.inject(InjectBySetter.java:48)
at org.nutz.dao.impl.entity.field.AbstractEntityField.setValue(AbstractEntityField.java:53)
at org.nutz.dao.impl.entity.field.NutMappingField.injectValue(NutMappingField.java:87)
at org.nutz.dao.impl.entity.NutEntity.getObject(NutEntity.java:232)
at org.nutz.dao.impl.sql.pojo.PojoQueryEntityCallback$1.createObject(PojoQueryEntityCallback.java:24)
at org.nutz.dao.pager.ResultSetLooping.doLoop(ResultSetLooping.java:75)
at org.nutz.dao.impl.sql.pojo.PojoQueryEntityCallback.invoke(PojoQueryEntityCallback.java:28)
at org.nutz.dao.impl.jdbc.NutPojo.onAfter(NutPojo.java:109)
at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:277)
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:53)
at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:66)
at org.nutz.dao.impl.interceptor.DaoLogInterceptor.filter(DaoLogInterceptor.java:22)
at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:64)
at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:139)
at org.nutz.dao.impl.sql.run.NutDaoRunner.runCallback(NutDaoRunner.java:158)
at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:125)
... 57 more
Caused by: org.nutz.castor.FailToCastObjectException: Fail to cast from <java.lang.String> to <com.******.core.team.enums.AdminLevel> for {} because:
IllegalArgumentException:No enum constant com.*******.core.team.enums.AdminLevel.
at org.nutz.castor.Castors.cast(Castors.java:264)
at org.nutz.castor.Castors.castTo(Castors.java:318)
at org.nutz.lang.inject.InjectBySetter.inject(InjectBySetter.java:38)
... 72 more
Caused by: java.lang.IllegalArgumentException: No enum constant com.*******.core.team.enums.AdminLevel.
at java.lang.Enum.valueOf(Enum.java:238)
at org.nutz.castor.castor.String2Enum.cast(String2Enum.java:13)
at org.nutz.castor.castor.String2Enum.cast(String2Enum.java:6)
at org.nutz.castor.Castors.cast(Castors.java:252)
... 74 more