zoukankan      html  css  js  c++  java
  • 在ibatis中isNotNull和isNotEmpty的区别

     在ibatis in action 这本书中定义单元标签:

    Unary tags examine the state of a bean property and do not perform comparisons
    against any other values. The body content is included if the result of the state is
    true. All unary tags share the property attribute. The property attribute is used to
    specify the property on the parameter object that will be used to examine the
    state. The name of the tag indicates the type of state that is being examined. The
    unary tag attributes are shown in table 8.4.
    All of the attributes in table 8.4 are available in the unary dynamic SQL tags listed
    in table 8.5.
    Table 8.4 Unary tag attributes
    property
    (required)
    The property of the parameter used for state comparison.
    prepend
    (optional)
    This value is used to prepend to the tag’s resulting body content. The prepend
    value will not be prepended (a) when the tag’s resulting body content is empty; (b) if
    the tag is the first to produce body content and is nested in a tag with the remove-
    FirstPrepend attribute set to true; or (c) if the tag is the first to produce body content
    following a <dynamic> tag with a prepend attribute value that is not empty.
    open
    (optional)
    This value is used to prefix to the tag’s resulting body content. The open value will
    not be prefixed if the tag’s resulting body content is empty. The open value is prefixed
    before the prepend attribute’s value is prefixed. For example, if prepend="OR
    " and open="(", then the resulting combined prefix would be "OR (".
    close
    (optional)
    This value is used to append to the tag’s resulting body content. The append value
    will not be appended if the tag’s resulting body content is empty.
    removeFirst-
    Prepend
    (optional)
    This attribute value defines whether the first nested content-producing tag will have
    its prepend value removed.
    Table 8.5 Unary tags
    <isProperty-
    Available>
    Determines whether the specified property exists in the parameter. With a
    bean, it looks for a property. With a map, it looks for a key.
    <isNotProperty-
    Available>
    Checks whether the specified property does not exist in the parameter. With
    a bean, it looks for a property. With a map, it looks for a key.
    <isNull> Determines whether the specified property is null. With a bean, it looks at
    the value of the property getter. With a map, it looks for a key. If the key
    does not exist, it will return true.
    <isNotNull> Determines whether the specified property is anything other than null. With
    a bean, it looks at the value of the property getter. With a map, it looks for a
    key. If the key does not exist, it will return false.

     <isEmpty> Determines whether the specified property is a null or empty String, Collection,
    or String.valueOf().
    <isNotEmpty> Determines whether the specified property is not a null or empty String,
    Collection, or String.valueOf().

  • 相关阅读:
    3DMax的OFusion插件使用问题
    eclipse调试java调用matlab程序的7.17dll找不到的问题
    C++malloc,calloc,realloc,free函数
    北漂工作心得
    [置顶] 使用sping AOP 操作日志管理
    你不知道的Eclipse用法:使用Allocation tracker跟踪Android应用内存分配
    [置顶] 程序员扩充人脉那些事儿
    linux常见笔试题
    数学之路(3)-机器学习(3)-机器学习算法-神经网络[4]
    Android屏幕相关设置
  • 原文地址:https://www.cnblogs.com/wanghongyewang/p/4009525.html
Copyright © 2011-2022 走看看