单选题 要求根据员工的id查找员工信息,下列使用@Select注解的代码书写正确的是()。

A、 @Select("select ∗ from tb_worker where id = ?")
B、 @Select("select ∗ from tb_worker where id = #id")
C、 @Select("select ∗ from tb_worker where id = {id}")
D、 @Select("select ∗ from tb_worker where id = #{id}")
下载APP答题
由4l***9f提供 分享 举报 纠错

相关试题

单选题 在MyBatis配置文件中,<mappers>元素的主要作用是什么( )

A、配置数据库连接信息
B、注册Mapper接口或XML映射文件
C、设置全局配置项
D、定义动态SQL语句

单选题 以下哪个元素用于在MyBatis中实现动态SQL的元素迭代?( )

A、<iterate>
B、<foreach>
C、<collection>
D、<map>

单选题 以下哪个元素用于在MyBatis中实现多对一关联映射( )

A、<many-to-many>
B、<association>
C、<collection>
D、<one-to-many>

单选题 以下哪个元素用于在MyBatis中实现多对多关联映射( )

A、<many-to-many>
B、<association>
C、<collection>
D、<one-to-many>

单选题 下列属性中,不属于<association>元素属性的是()。

A、property
B、select
C、ofType
D、autoMapping

单选题 下列元素中,不属于<environments>元素的子元素的是()。

A、<environment>
B、<dataSource>
C、<transactionManager>
D、<plugins>

单选题 以下哪个元素用于在MyBatis中实现动态SQL的更新操作( )

A、<update>
B、<delete>
C、<set>
D、 <insert>

单选题 下列元素中,可以为POJO实体类设置别名的是()。

A、<typeAliases>元素
B、<settings>元素
C、<mappers>元素
D、<properties>元素