解决办法
- 增加配置--xx_db_generatorConfig.xml
<property name="beginningDelimiter" value="`"/>
<property name="endingDelimiter" value="`"/>
<tabble xxx delimitAllColumns="true">
生成的字段都会变成desc
,`desc`这种格式
2 需要对每个对象值判断,否则就有NPE
`CityAgentContractPO agentContractList = cityAgentContractPOMapper.selectOneByExample(example); if (null != agentContractList && null != agentContractList.getStartTime()) {
res.setAgentStartTime(agentContractList.getStartTime());
} else {
res.setAgentStartTime(null);
}`
3 字段装箱/拆箱可能NPE
点击查看代码
int agentId = agentInfoPOMapper.insertSelective(agentInfoPO);
if (agentId > 0) {
openAccount(agentInfoPO.getAgentId());
} else {
throw new CityAgentException(CrmErrorEnums.ERROR_CITYAGENTLIB_ADD_VALID);
}