注解可以复用吗?

楚荆 楚荆 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

@Select({
"select",
"id, table_name, item_name, title, comment, status",
"from item_type",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="table_name", property="tableName", jdbcType=JdbcType.VARCHAR),
@Result(column="item_name", property="itemName", jdbcType=JdbcType.VARCHAR),
@Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
@Result(column="comment", property="comment", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.VARCHAR)
})
ItemType selectByPrimaryKey(Long id);

@Select({
"select",
"id, table_name, item_name, title, comment, status",
"from item_type"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="table_name", property="tableName", jdbcType=JdbcType.VARCHAR),
@Result(column="item_name", property="itemName", jdbcType=JdbcType.VARCHAR),
@Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
@Result(column="comment", property="comment", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.VARCHAR)
})
List<ItemType> selectAll();



像这两个方法的注解, @Results注解部分是完全相同的, 可以复用吗, 怎么操作?网上讨论注解复用的似乎没有
...全文

相关推荐

评论 7
收藏 已收藏
分享
返回顶部
楚荆
Java SE 62,620 成员 307,251 内容