MyBatis you need to specify Jdbctype when inserting null

Source: Internet
Author: User

MyBatis you want to insert a null value, you need to specify Jdbctype
MyBatis insert NULL returns an empty value exception, but PL/SQL does not prompt for errors, mainly because MyBatis cannot be converted

<insert id= "Insertinstrument"  parametertype= "com.labway.oa.po.Instruments" >insert  Intoinstruments (group_name,name,description,on_line,operator,x_sbxh,serial_no,x_lc,x_sbjd,vendor,<!--  X_sbsx, -->location,changed_on,changed_by,removed,low_threshold,high_threshold,stability_delta, Stability_number,port_number,discard_time,size_limit,time_out,polling_time,needs_calibration,needs_pm,holds_ Samples,include_subdirs,debug,store_in_db_file,db_file_prompt,x_jlsx,x_funcheck_status,x_timecheck_status,x_ Name,x_description,x_funcheck_date,x_timecheck_date,pm_date,x_pm_status,x_status,x_group_name)  values (#{ Group_name,jdbctype=varchar},#{name,jdbctype=varchar},#{description,jdbctype=varchar},#{on_line,jdbctype= Varchar},#{operator,jdbctype=varchar},#{x_sbxh,jdbctype=varchar},#{serial_no,jdbctype=varchar},#{x_lc,jdbctype =varchar},#{x_sbjd,jdbctype=varchar},#{vendor,jdbctype=varchar},<!-- #{x_sbsx}, -->#{location, Jdbctype=varchar},#{changed_on,javAtype=string,jdbctype=date,typehandler=com.labway.portal.handler.lwdatetypehandler},#{changed_by,jdbctype= VARCHAR}, ' F ', ' 0 ', ' 0 ', ' 0 ', ' 0 ', ' 0 ', ' 0 ', ' 0 ', ' 0 ', ' 0 ', ' f ', ' F ', ' F ', ' F ', ' F ', ' F ', ' f ', ' T ', ' f ', ' F ', #{name,jdbctype= Varchar},#{description,jdbctype=varchar},#{x_funcheck_date,javatype=string,jdbctype=date,typehandler= Com.labway.portal.handler.lwdatetypehandler},#{x_timecheck_date,javatype=string,jdbctype=date,typehandler= Com.labway.portal.handler.lwdatetypehandler},#{pm_date,javatype=string,jdbctype=date,typehandler= Com.labway.portal.handler.lwdatetypehandler},#{x_pm_status,jdbctype=varchar},#{x_status,jdbctype=varchar},#{x_ Group_name,jdbctype=varchar}) </insert>


This article is from the "Big Talk Program" blog, please be sure to keep this source http://houqida.blog.51cto.com/8877896/1584685

MyBatis you need to specify Jdbctype when inserting null

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.