@Repository public class EntityValidationCrudJdbcImpl extends java.lang.Object implements IEntityValidationCrud
Constructor and Description |
---|
EntityValidationCrudJdbcImpl() |
EntityValidationCrudJdbcImpl(javax.sql.DataSource datasource) |
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.
|
<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.
|
void |
setDatasource(javax.sql.DataSource datasource) |
public static final Logger logger
public EntityValidationCrudJdbcImpl()
public EntityValidationCrudJdbcImpl(javax.sql.DataSource datasource)
public void setDatasource(javax.sql.DataSource datasource)
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 entityCopyright © 2007-2020 EDIT. All Rights Reserved.