Home > Database > Mysql Tutorial > Oracle ADF:实现联合主键校验的方法

Oracle ADF:实现联合主键校验的方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:10:40
Original
1268 people have browsed it

Oracle ADF:实现联合主键校验的方法,如果数据库中存在联合主键,比如 Vcode 和Vcompany(查看方法,Oracle数据库表右键编辑然后查看

如果数据库中存在联合主键,比如 Vcode 和Vcompany(查看方法,Oracle数据库表右键编辑然后查看键信息,查找UK信息)



在ADF中 保存数据之前 需要校验下 Vcode和Vcompany是否联合唯一的操作

打开EO→General→Alternate Keys 点新增,选中和数据库中对应的若干字段



在Bussiness Rules -Entity Validators新建一个Unique Key 型Validator,选中设置好的 AltKey,在Failure Handling 输出错误信息.

此处参数名称在{}中, 格式为source.字段:如图:



选择设置好的Unique Key Validator 查看属性 EntityLevelOnly 设为true

在点保存时,则不先进入ManageBean而是先在EO校验,错误信息来自设置好的Validator的信息.

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template