java - iBATIS - Defining 'javaType' and 'jdbcType' -
while defining resultmap
in ibatis, provides option set javatype
, jdbctype
each property column mapping.
e.g.
<resultmap id="employee" class="com.mycompany.employee"> <result property="firstname" column="first_name" javatype="?" jdbctype="?"/> </resultmap>
wanted know when should defining javatype
, jdbctype
? have seen mapping just works without defining these properties , in others have define them.
edit: see selected answer below above question.
also, have exhaustive list out of javatype
, jdbctype
should defined?
edit: javatype
should 1 of well-known types e.g. java.lang.string
, java.util.date
, jdbctype
should coming out of java.sql.types
thanks in advance!
for jdbctype
documentation (for ibatis 3) states:
the jdbc type required nullable columns upon insert, update or delete.
on page 33 in document list of supported jdbc types.
for javatype
attribute says:
ibatis can figure out type if you’re mapping javabean. however, if mapping hashmap, should specify javatype explicitly ensure desired behaviour.
Comments
Post a Comment