Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Types MyBatis-持有多种类型_Types_Insert_Mybatis - Fatal编程技术网

Types MyBatis-持有多种类型

Types MyBatis-持有多种类型,types,insert,mybatis,Types,Insert,Mybatis,在开始之前,这里是我的课程结构 人员 人员体质(扩展人员) 人员士气(扩展人员) 企业(提升员工士气) 协会(提高员工士气) 我试图在数据库中插入一个“Personne”,我需要检查它是“PersonnePhysique”、“enterprise”还是“Association”。 所以,我在我的地图绘制程序中这样做: <insert id="creerPersonne" parameterType="Personne"> .... <choose>

在开始之前,这里是我的课程结构

  • 人员

    • 人员体质(扩展人员)

    • 人员士气(扩展人员)

      • 企业(提升员工士气)
      • 协会(提高员工士气)
我试图在数据库中插入一个“Personne”,我需要检查它是“PersonnePhysique”、“enterprise”还是“Association”。 所以,我在我的地图绘制程序中这样做:

<insert id="creerPersonne" parameterType="Personne">
   ....

<choose>
    <when test="getClass() instanceof fr.maaf.personne.PersonnePhysique">
        1, 
    </when>
    <when test="getClass() instanceof fr.maaf.personne.Association">
        2, 
    </when>
    <when test="getClass() instanceof fr.maaf.personne.Entreprise">
        2, 
    </when>
</choose>

  ...
</insert>

....
1.
2.
2.
...
但这些测试都没有通过。
我做错了什么?

我找到了一个解决方案,尽管不是在官方文档中,但它对未来版本来说应该不会是问题:if test=“\u参数instanceof fr.maaf.personne.enterprise”