`
wangwengcn
  • 浏览: 175131 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

validate

 
阅读更多

内建约束

注解 应用目标 运行时检查 Hibernate元数据效果
@Length(min=, max=) property (String) check if the string length match the range Column length will be set to max
@Length(min=, max=) property (String) 检查字符串长度是否符合范围 列长度会被设到最大值
@Max(value=) property (numeric or string representation of a numeric) check if the value is less than or equals to max Add a check constraint on the column
@Max(value=) property (numeric or string representation of a numeric) 检查值是否小于或等于最大值 对列增加一个检查约束
@Min(value=) property (numeric or string representation of a numeric) check if the value is more than or equals to min Add a check constraint on the column
@Min(value=) property (numeric or string representation of a numeric) 检查值是否大于或等于最小值 对列增加一个检查约束
@NotNull property check if the value is not null Column(s) are not null
@NotNull property 检查值是否非空(not null) 列不为空
@Past property (date or calendar) check if the date is in the past Add a check constraint on the column
@Past property (date or calendar) 检查日期是否是过去时 对列增加一个检查约束
@Future property (date or calendar) check if the date is in the future none
@Future property (date or calendar) 检查日期是否是将来时 none
@Pattern(regex="regexp", flag=) property (string) check if the property match the regular expression given a match flag (see java.util.regex.Pattern ) none
@Pattern(regex="regexp", flag=) property (string) 检查属性是否与给定匹配标志的正则表达式相匹配(见 java.util.regex.Pattern ) none
@Range(min=, max=) property (numeric or string representation of a numeric) check if the value is between min and max (included) Add a check constraint on the column
@Range(min=, max=) property (numeric or string representation of a numeric) 检查值是否在最小和最大值之间(包括临界值) 对列增加一个检查约束
@Size(min=, max=) property (array, collection, map) check if the element size is between min and max(included) none
@Size(min=, max=) property (array, collection, map) 检查元素大小是否在最小和最大值之间(包括临界值) none
@AssertFalse property check that the method evaluates to false (useful forconstraints expressed in code rather than annotations) none
@AssertFalse property 检查方法的演算结果是否为false(对以代码方式而不是注解表示的约束很有用) none
@AssertTrue property check that the method evaluates to true (useful for constraints expressed in code rather than annotations) none
@AssertTrue property 检查方法的演算结果是否为true(对以代码方式而不是注解表示的约束很有用) none
@Valid property (object) Perform validation recursively on the associatedobject none
@Valid property (object) 对关联对象递归的进行验证 none
分享到:
评论

相关推荐

    jquery validate 信息气泡提示

    在网页开发中,jQuery Validate 是一个非常常用的验证插件,用于对用户输入的数据进行校验,确保数据的有效性和完整性。这个插件可以帮助开发者创建复杂的表单验证规则,提高用户体验,减少服务器端的压力。结合 ...

    mysql 安装密码校验插件validate_password.docx

    以下是安装validate_password插件的详细步骤,以及相关的配置和使用方法。 1. **修改配置文件** 首先,你需要编辑MySQL的配置文件,通常位于`/etc/my.cnf`(根据你的操作系统和安装路径可能有所不同)。使用命令`...

    JQuery+validate校验+messages_zh中文的js库

    `jquery.validate.js` 和 `jquery.validate.min.js` 就是这个插件的源码和压缩版。这个插件提供了一套强大的规则引擎,可以轻松地为表单元素添加验证规则,例如必填、邮箱格式、数字范围等,极大地提高了用户输入...

    jquery validate 使用详解

    ### jQuery Validate 插件使用详解 #### 一、概述 jQuery Validate 是一款强大的表单验证插件,基于 jQuery 框架开发而成。它能够帮助开发者轻松实现客户端表单验证功能,大大提高了用户体验并减少了服务器端的...

    jquery validate默认错误提示显示位置修改

    ### 修改jQuery Validate默认错误提示显示位置 在网页开发过程中,表单验证是非常重要的一个环节,它不仅能够提高用户体验,还能确保数据的有效性和安全性。jQuery Validate插件是实现表单验证功能的一个强大工具,...

    validate方法

    标题中的"validate方法"通常指的是在编程中用于验证数据或对象的方法。这可能是为了确保输入的数据符合特定的格式、规则或者限制,以防止错误、安全问题或者数据不一致。在不同的编程语言和框架中,validate方法可能...

    jquery.validate 版本大全

    jquery.validate.1.9.0.min.js jquery.validate.1.12.0.min.js jquery.validate.1.13.1.min.js jquery.validate.1.16.0.min.js jquery.validate.1.14.0.min.js jquery.validate.1.15.1.min.js jquery.validate....

    jQueryValidate.rar

    《jQuery Validate插件详解及其应用》 在Web开发中,表单验证是不可或缺的一部分,它确保用户输入的数据符合预设的规则,提高了用户体验并减少了服务器端的负担。jQuery Validate插件是实现这一功能的强大工具,它...

    vue中使用vee-validate

    Vee-validate 是一个流行的 Vue.js 库,用于表单验证和字段验证。它提供了一种简洁的方式来处理用户输入的数据验证,使得在 Vue 应用中实现表单验证变得更加容易。以下是如何在 Vue 项目中引入并使用 vee-validate,...

    开源项目-lyft-protoc-gen-validate.zip

    【开源项目-lyft-protoc-gen-validate】是一个在IT领域中非常有价值的工具,尤其对于那些使用Protocol Buffers(简称protobuf)进行数据序列化的开发者来说。protobuf是由Google开发的一种高效的数据序列化协议,...

    jquery.validate.js 1.8.1 + 实例

    `jQuery Validate` 插件1.8.1版本提供了丰富的功能,包括基本的验证规则、自定义验证规则以及错误消息定制。 ### jQuery Validate 插件基础 `jQuery Validate` 的核心功能是验证表单字段,它通过添加额外的属性到 ...

    Python库 | validate_email_wt-1.4.5-py2.py3-none-any.whl

    在这个场景中,我们关注的是一个名为`validate_email_wt`的Python库,版本为1.4.5,它是一个`.whl`格式的文件。`.whl`文件是Python的预编译轮子包,用于简化安装过程,特别是对于那些不支持`pip`自动编译源码的环境...

    jquery validate 表单验证

    jQuery Validate插件是jQuery库的一个扩展,专门用于实现这样的功能。这个插件提供了一种简便的方式来对HTML表单进行验证,避免了服务器端不必要的负载。接下来,我们将深入探讨jQuery Validate的使用方法、核心概念...

    ajax验证用户名是否存在 与 rapid validate 的使用

    使用Rapid Validate可以帮助开发者在早期发现并修复问题,提升代码质量。 安装Rapid Validate通常通过npm(Node.js包管理器)进行: ```bash npm install -g rapid-validate ``` 使用时,在命令行中运行: ```...

    jq.validate文件

    `jquery.validate.js`是这个插件的核心文件,包含了所有验证功能的实现。 在网页开发中,数据验证是一个至关重要的环节,可以防止用户提交无效或不完整的数据。`jQuery Validate` 插件通过添加自定义的验证规则和...

    jquery.validate.js下载

    jquery.validate.js jquery.validate.js

    vue表单验证validate.min.js使用例子,formdata 文件上传表单提交

    `validate.min.js`是一个强大的表单验证库,它可以让我们自定义验证规则并提供中文错误提示,使得开发更加便捷。 首先,`validate.min.js`的使用通常涉及到以下步骤: 1. 引入`validate.min.js`库:在HTML文件中...

    jQuery Validate 1.1.2

    jQuery Validate 是一个强大的JavaScript库,专门用于前端表单验证,由jQuery团队开发并维护。它极大地简化了在网页上创建高效、用户友好的验证规则的过程,避免了开发者编写大量重复的验证代码。jQuery Validate ...

    自定义 validate验证 struts1框架

    在Struts1中,`validate`是用于业务逻辑校验的重要机制,它可以有效地预防无效数据进入数据库,从而提高系统的稳定性和安全性。 自定义`validate`验证是Struts1框架的一个关键特性,允许开发者根据业务需求定制特定...

    jquery validate例子

    《jQuery Validate插件详解与实例应用》 在Web开发中,表单验证是不可或缺的一环,它能够确保用户输入的数据符合预设的规则,提高数据的准确性和安全性。jQuery Validate是一个强大的JavaScript库,专为jQuery设计...

Global site tag (gtag.js) - Google Analytics