can not find xxx.xxx

Problem description:

Unit test an interface of a former colleague, and the runtime prompts that the mapping of an attribute field in the po class cannot be found

. Problem analysis:

According to the described exception information, the attribute is found in the class, and both set and get are available. The mapping also exists in mapper.xml.

Check the code version. The production environment of the historical version is running normally, so the new code is compared

to locate the problem. The

po class describes the user type field, and the isXXX

po class defines constants. IsXXX is only different from the first letter of the attribute field.

Therefore , when the file in Mapper.xml is doing mapping processing, the first mapping is the field defined by the constant, and this field does not have SET GET, so an error is reported

. Summary of the problem:

1. Do not write constants In the PO class, but to be written separately in the constant class 2.

Boolean type attributes, do not start with is

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326793659&siteId=291194637