【问题标题】:byte? doesn't work as a parameter type in an iBatis parameterMap字节?不能作为 iBatis parameterMap 中的参数类型
【发布时间】:2011-06-02 00:56:16
【问题描述】:

根据the iBatis docs,使用“字节?”作为类型值应该在parameterMap 中工作。我正在使用 DataMapper 1.6.1 版。

我收到的错误消息是:Could not load type from string value 'byte?'.

这是在堆栈跟踪中显示此信息的配置异常:

加载时发生错误 SqlMap。

  • 检查参数映射typeHandler属性''(必须是 ITypeHandlerCallback 实现)。
  • 在[sqlMap embedded="MyApp.Data.Config.Rate.xml, MyApp" Mxmlns="http://ibatis.apache.org/dataMapper"]中出现错误
  • 检查 Rate.InsertParams。]

这是 Rate.InsertParams 的 XML 块:

<parameterMaps>
<parameterMap id="InsertParams" class="RateCategory">
  <parameter property="RateId" column="RateId" type="int"/>
  <parameter property="Name" column="Name" type="string" size="32"/>
  <parameter property="Charge" column="Charge" type="decimal?"/>
  <parameter property="ChargeTypeId" column="ChargeTypeId" type="byte?"/>
</parameterMap>

任何想法为什么它不起作用?

【问题讨论】:

    标签: configuration ibatis ibatis.net


    【解决方案1】:

    据我所知,没有任何“字节”?别名。 Here is a proof.

    您还可以从该文件中确定哪些是肯定支持的,哪些不支持。

    “代码从不说谎。”文档确实:(

    【讨论】:

      【解决方案2】:

      经过大量询问和发布,最终答案是文档有误。

      The official iBatis.Net forum had this to say:

      “你有几个选择:

      1. 只需使用 type="byte"
      2. 不要指定类型
      3. 字节?是语法糖 System.Nullable`1[[System.Byte]]"

      这基本上是我自己已经弄清楚的。诠释?有效,但字节?没有。短线也不行吗?还是长?

      文档需要修复。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-07-27
        相关资源
        最近更新 更多