use of org.hibernate.envers.AuditOverrides in project hibernate-orm by hibernate.
the class AuditedPropertiesReader method addPropertyAuditingOverrides.
/**
* Add the {@link AuditOverride} annotations.
*
* @param property the property being processed
* @param propertyData the Envers auditing data for this property
*/
private void addPropertyAuditingOverrides(XProperty property, PropertyAuditingData propertyData) {
final AuditOverride annotationOverride = property.getAnnotation(AuditOverride.class);
if (annotationOverride != null) {
propertyData.addAuditingOverride(annotationOverride);
}
final AuditOverrides annotationOverrides = property.getAnnotation(AuditOverrides.class);
if (annotationOverrides != null) {
propertyData.addAuditingOverrides(annotationOverrides);
}
}
use of org.hibernate.envers.AuditOverrides in project hibernate-orm by hibernate.
the class AuditedPropertiesReader method computeAuditOverrides.
/**
* @param clazz Source class.
*
* @return List of @AuditOverride annotations applied at class level.
*/
private List<AuditOverride> computeAuditOverrides(XClass clazz) {
final AuditOverrides auditOverrides = clazz.getAnnotation(AuditOverrides.class);
final AuditOverride auditOverride = clazz.getAnnotation(AuditOverride.class);
if (auditOverrides == null && auditOverride != null) {
return Arrays.asList(auditOverride);
} else if (auditOverrides != null && auditOverride == null) {
return Arrays.asList(auditOverrides.value());
} else if (auditOverrides != null && auditOverride != null) {
throw new MappingException("@AuditOverrides annotation should encapsulate all @AuditOverride declarations. " + "Please revise Envers annotations applied to class " + clazz.getName() + ".");
}
return Collections.emptyList();
}
Aggregations