mybatis中取出Oracle日期数据的显示为null
xml文件中已经将birth的javatype指明为了java.util.Date<resultMaptype="Teacher"id="TeacherResult"><...
xml文件中已经将birth的javatype指明为了java.util.Date
<resultMap type="Teacher" id="TeacherResult">
<result property="id" column="tid"/>
<result property="name" column="tname"/>
<result property="sex" column="tsex"/>
<result property="birth" column="sbirth" javaType="java.util.Date" jdbcType="DATE"/>
</resultMap>
查询的语句
<select id="getTeacherById" parameterType="int" resultMap="TeacherResult">
select * from teacher where tid =#{id}
</select>
运行的时候得到了一个Teacher对像t,可是t.brith确为null 展开
<resultMap type="Teacher" id="TeacherResult">
<result property="id" column="tid"/>
<result property="name" column="tname"/>
<result property="sex" column="tsex"/>
<result property="birth" column="sbirth" javaType="java.util.Date" jdbcType="DATE"/>
</resultMap>
查询的语句
<select id="getTeacherById" parameterType="int" resultMap="TeacherResult">
select * from teacher where tid =#{id}
</select>
运行的时候得到了一个Teacher对像t,可是t.brith确为null 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询