MyBatis columns mapping with MySQL Keywords and Reserved Words

1 week ago 11
ARTICLE AD BOX
@Column(name = "`year`") private String year; @Column(name = "`year_month`") private String yearMonth; <result column="year" property="year" jdbcType="VARCHAR"/> <result column="year_month" property="yearMonth" jdbcType="VARCHAR"/>

I annotated the year and yearMonth fields with the @Column annotation, but the query result is null.
I want to handle compatibility in DefaultResultSetHandler. Any suggestions?

the below sql is mybatis log.

<artifactId>mybatis</artifactId> <version>3.5.14</version> SELECT creation_date, created_by, last_update_date, last_updated_by, object_version_number, id, request_week, `year`, `year_month` FROM dppcm_po_no_import WHERE ((po_no IN ('305743571', '305743990', '305777642', '305778006', '305778007', '305778204')));
Read Entire Article