我在使用hibernate validate4的@AssertTrue功能时出现
Annotated methods must follow the JavaBeans naming convention错误是因为对function的命名不符合规范
@AsserTrue/@AssertFalse
是Hibernate validate的两个声名,可用在声明字段或函数前
我用它声明在函数前,用来判断有一定逻辑关系的数据验证,它包括一个属性
message,用来在不满足判定(@AssertTrue返回false/@AssertFalse返回true时的错误信息)
一开始,我将这个function名定义
@AssertTrue(message="Price is unAvailable")
public boolean validatePrice(){
if(claimAmount < 10){
return false;
} else {
return true;
}
}
这时候就报
Annotated methods must follow the JavaBeans naming convention
错误,将函数名从validatePrice改成isAvailablePrice,就可以通过了
说明AssertTrue要求函数名以is开头
@AssertTrue(message="Price is unAvailable")
public boolean isAvailablePrice(){
if(claimAmount < 10){
return false;
} else {
return true;
}
}
分享到:
相关推荐
the annotated STL source the annotated STL source
the.annotated.turing
The Annotated C++ Reference Manual 一共四个压缩包
这是《The Thinking in Java Annotated Solution Guide》的所有代码的压缩包。
The Annotated C++ Reference Manual.part2
The Common Language Infrastructure Annotated Standard
The Annotated C++ Reference Manual
The Annotated C++ Reference Manual 英文 PDF 复印扫描版 part3 Bjarne Stroustrup 差
The Annotated C++ Reference Manual 英文 PDF 复印扫描版 part1 Bjarne Stroustrup 差 part2下载地址 http://download.csdn.net/detail/sfgassdfg/9572821 part3下载地址 ...
Thinking in Java 4th Edition 英文文字版,带书签 Annotated Solution Guide 有代码
The Annotated C++ Reference Manual(共11部分) 传说中的原版巨作,不差页
The Annotated C++ Reference Manual (共11部分) 传说中的原版巨作,不差页
我可以负责任的说, 在internet 的电子书下载史上, 还没有这本被列为C++四书五经的神品之任何形式的资源, 到国外买(国内连影印都没有), 或从大学图书馆借, 是你唯一的办法, 我经历了托人买国外原版->复印->Canon ...
The Annotated C++ Reference Manual (共11部分) 传说中的原版巨作,不差页 不好意思,我的号实在没分了~
The Annotated Turing: A Guided Tour through Alan Turing's Historic Paper on Computability and the Turing Machine Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN ...
Java 编程思想第四版,章节练习题参考答案
The Annotated C++ Reference Manual (共11部分) 传说中的原版巨作,不差页
副标题:他的生平、思想及论文解读原作名: The Annotated Turing作者: Charles Petzold图灵机是英国数学家阿兰·麦席森·图灵提出的一种抽象计算模型,本书深入剖析了图灵这篇描述图灵机和可计算性的原始论文《论可...
首先真心感谢slimzhao的资源共享,他对经典C++书籍ARM的扫描确实很全面!我在阅读过程中把它这一资源分解成每个章节一个PDF,同时把其中的缺页和错页全部调整正确!如果是需要全本书一个PDF,烦请各位下载slimzhao的...