我在使用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 Thinking in Java Annotated Solution Guide》则是对原书习题的详尽解答,帮助读者巩固所学知识并解决实际编程问题。 这个压缩包包含的是书中所有代码示例,对于学习Java编程非常有帮助。以下是这些代码...
《The Annotated Turing》是由Charles Petzold撰写的一本经典计算机科学著作,它深入解析了艾伦·图灵在1936年提出的图灵机模型,并以此为基础探讨了计算理论的基础。这本书对于理解计算机科学的基本原理至关重要,...
The Annotated C++ Reference Manual 一共四个压缩包
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下载地址 ...
The Annotated C++ Reference Manual(共11部分) 传说中的原版巨作,不差页
The Annotated C++ Reference Manual (共11部分) 传说中的原版巨作,不差页
我可以负责任的说, 在internet 的电子书下载史上, 还没有这本被列为C++四书五经的神品之任何形式的资源, 到国外买(国内连影印都没有), 或从大学图书馆借, 是你唯一的办法, 我经历了托人买国外原版->复印->Canon ...
"Thinking in Java 4th Edition + Annotated Solution Guide (代码)英文文字版 带书签 有答案" 指的是该资源包含了《Thinking in Java》第四版的英文文本,同时附带有注解的解决方案指南,这将有助于读者在遇到...
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部分) 传说中的原版巨作,不差页
带注释的c++参考 带注释的c++参考 。
副标题:他的生平、思想及论文解读原作名: The Annotated Turing作者: Charles Petzold图灵机是英国数学家阿兰·麦席森·图灵提出的一种抽象计算模型,本书深入剖析了图灵这篇描述图灵机和可计算性的原始论文《论可...