@Repository @Qualifier(value="EntityValidationDaoHibernateImpl") public class EntityValidationDaoHibernateImpl extends CdmEntityDaoBase<EntityValidation> implements IEntityValidationDao
defaultBeanInitializer, flushAfterNo, LEFTOUTER_OPS, type
INCLUDE_UNPUBLISHED, NO_UNPUBLISHED
Constructor and Description |
---|
EntityValidationDaoHibernateImpl() |
Modifier and Type | Method and Description |
---|---|
void |
deleteEntityValidation(java.lang.String validatedEntityClass,
int validatedEntityId)
Delete validation result for the specified entity, presumably because it
has become obsolete.
|
java.util.List<EntityValidation> |
getEntitiesViolatingConstraint(java.lang.String validatorClass)
Get all entities that violated a particular constraint.
|
EntityValidation |
getEntityValidation(java.lang.String validatedEntityClass,
int validatedEntityId)
Get the validation result for a particular entity.
|
java.util.List<EntityValidation> |
getEntityValidations()
Get all validation results for all validated entities.
|
java.util.List<EntityValidation> |
getEntityValidations(Severity severity)
Get all validation results.
|
java.util.List<EntityValidation> |
getEntityValidations(java.lang.String validatedEntityClass)
Get all validation results for all validated entities of the specified
type.
|
java.util.List<EntityValidation> |
getEntityValidations(java.lang.String validatedEntityClass,
Severity severity)
Get all validation results for all entities of the specified type.
|
<T extends ICdmBase> |
saveEntityValidation(T validatedEntity,
java.util.Set<javax.validation.ConstraintViolation<T>> errors,
CRUDEventType crudEventType,
java.lang.Class<?>[] validationGroups)
Save the result of an entity validation to the error tables.
|
addExample, addGroups, clear, count, count, count, count, countByParam, countByParamWithRestrictions, countGroups, createCriteria, delete, entityType, exists, findById, findByParam, findByParam, findByParamWithRestrictions, findByUuid, findByUuid, findByUuidWithoutFlush, getAuditReader, getCriteria, getSession, getType, group, list, list, list, list, list, list, list, list, list, list, load, load, load, load, loadList, lock, makeAuditQuery, merge, merge, refresh, refresh, replace, save, saveAll, saveCdmObj, saveOrUpdate, saveOrUpdateAll, setDefaultBeanInitializer, setPagingParameter, setPagingParameter, update
addCriteria, addFieldPredicate, addLimitAndStart, addLimitAndStart, addLimitAndStart, addOrder, addOrder, addOrder, addPageSizeAndNumber, addPageSizeAndNumber, addPageSizeAndNumber, addPageSizeAndNumber, flush, getSessionFactory, orderByClause, setSessionFactory, splitCollection
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, count, count, count, count, countByParam, countByParamWithRestrictions, delete, exists, findById, findByParam, findByParam, findByParamWithRestrictions, findByUuid, findByUuidWithoutFlush, flush, getSession, getType, group, list, list, list, list, list, list, list, list, list, load, load, load, loadList, lock, merge, merge, refresh, refresh, replace, save, saveAll, saveOrUpdate, saveOrUpdateAll, update
public <T extends ICdmBase> void saveEntityValidation(T validatedEntity, java.util.Set<javax.validation.ConstraintViolation<T>> errors, CRUDEventType crudEventType, java.lang.Class<?>[] validationGroups)
IEntityValidationCrud
Note that validation groups that have been applied could also have been
extracted from the specified set of ConstraintViolation
s, using
the metadata APIs of the javax.validation framework. However the set of
ConstraintViolation
s is most likely to result from a call to one
of the validate
methods in Validator
. These methods may
return an empty set, meaning "nothing wrong". If so, all previously
created error records for the entity must now be deleted, but, again,
only in so far as they resulted from applying the same validation groups.
Therefore the applied validation groups are provided separately.
saveEntityValidation
in interface IEntityValidationCrud
validatedEntity
- The validated entityerrors
- All constraints violated by the specified entitycrudEventType
- The CRUD operation triggering the validationpublic void deleteEntityValidation(java.lang.String validatedEntityClass, int validatedEntityId)
IEntityValidationCrud
deleteEntityValidation
in interface IEntityValidationCrud
validatedEntityClass
- The fully qualified class name of the entity's class.validatedEntityId
- The id of the entitypublic EntityValidation getEntityValidation(java.lang.String validatedEntityClass, int validatedEntityId)
IEntityValidationDao
getEntityValidation
in interface IEntityValidationDao
validatedEntityClass
- The fully qualified class name of the entity's class.validatedEntityId
- The id of the entityEntityValidation
or null if the entity has not
been validated yetpublic java.util.List<EntityValidation> getEntityValidations()
IEntityValidationDao
getEntityValidations
in interface IEntityValidationDao
EntityValidation
spublic java.util.List<EntityValidation> getEntityValidations(java.lang.String validatedEntityClass)
IEntityValidationDao
getEntityValidations
in interface IEntityValidationDao
validatedEntityClass
- The fully qualified class name of the entity classEntityValidation
spublic java.util.List<EntityValidation> getEntitiesViolatingConstraint(java.lang.String validatorClass)
IEntityValidationDao
validatorClass
argument is a String
(like all the
***Class
arguments). This is because it is stored as such in the
database, and also because the Class
object itself may not be on
the caller's classpath - e.g. when called from the TaxEditor.getEntitiesViolatingConstraint
in interface IEntityValidationDao
validatorClass
- The fully qualified class name of the
ConstraintValidator
.EntityValidation
spublic java.util.List<EntityValidation> getEntityValidations(java.lang.String validatedEntityClass, Severity severity)
IEntityValidationDao
getEntityValidations
in interface IEntityValidationDao
validatedEntityClass
- The fully qualified class name of the entity class.severity
- The severity of the EntityConstraintViolation
s
associated with the EntityValidation
EntityValidation
spublic java.util.List<EntityValidation> getEntityValidations(Severity severity)
IEntityValidationDao
getEntityValidations
in interface IEntityValidationDao
severity
- The severity of the EntityConstraintViolation
s
associated with the EntityValidation
EntityValidation
sCopyright © 2007-2020 EDIT. All Rights Reserved.