protected final void validateBean(B bean, boolean overrideSystem) throws InvalidDataException
{
if( !overrideSystem && bean.isSystemType() )
{
throw new ModifyingSystemTypeException();
}
List<ValidationError> errors = new ArrayList<ValidationError>();
// Ask the full implementation to do any checking
doValidationBean(bean, errors);
// Only one uuid per institution
Criterion c4 = Restrictions.eq("uuid", bean.getUuid());
Criterion c5 = Restrictions.eq("institution", CurrentInstitution.get());
Criterion c6 = Restrictions.ne("id", bean.getId());
if( entityDao.countByCriteria(c4, c5, c6) > 0 )
{
errors.add(new ValidationError("uuid",
CurrentLocale.get("com.tle.core.services.entity.generic.validation.unique.uuid")));
}
if( !errors.isEmpty() )
{
throw new InvalidDataException(errors);
}
}
AbstractEntityServiceImpl.java 文件源码
java
阅读 35
收藏 0
点赞 0
评论 0
项目:Equella
作者:
评论列表
文章目录