5
mybatis | xml 的 property 和 column
source link: https://benpaodewoniu.github.io/2023/02/04/java226/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
mybatis | xml 的 property 和 column
我们在定义 xml
的时候,经常这样定义。
<resultMap type="com.fate.backstage.entity.user.UserInfo" id="UserInfo">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="password" column="password"/>
<result property="nickName" column="nickName"/>
<result property="email" column="email"/>
<result property="token" column="token"/>
<result property="erc20_address" column="erc20_address"/>
<result property="create_time" column="create_time"/>
</resultMap>
column
- 对应我们数据库表中的字段名称
property
- 对应我们的实体类的属性,比如:
User
中的属性userName
,要和数据库表m_user
中的name
对应
- 对应我们的实体类的属性,比如:
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK