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().

  • 相关阅读:
    linux 系统函数 basename和dirname
    写linux脚本你怎么能不知道位置参数!?
    Linux 使用中history 默认记录数不够用了?
    在C/C++中常用的符号
    java23种设计模式之一: 策略模式
    工作中用到的git命令
    注解@Aspect实现AOP功能
    AOP 面向切面 记录请求接口的日志
    javaWeb导出POI创建的多个excel的压缩文件
    nginx的重试机制以及nginx常用的超时配置说明
  • 原文地址:https://www.cnblogs.com/wanghongyewang/p/4009525.html
Copyright © 2011-2022 走看看