private void addPropertyJoinTables(XProperty property, PropertyAuditingData propertyData) { // first set the join table based on the AuditJoinTable annotation final AuditJoinTable joinTable = property.getAnnotation(AuditJoinTable.class); if (joinTable != null) { propertyData.setJoinTable(joinTable); } else { propertyData.setJoinTable(DEFAULT_AUDIT_JOIN_TABLE); } }
/** * Process the {@link AuditOverride} annotations for this property. * * @param property the property for which the {@link AuditOverride} annotations are being * processed * @param propertyData the Envers auditing data for this property * @return {@code false} if isAudited() of the override annotation was set to */ private boolean processPropertyAuditingOverrides( XProperty property, PropertyAuditingData propertyData) { // if this property is part of a component, process all override annotations if (this.auditedPropertiesHolder instanceof ComponentAuditingData) { final List<AuditOverride> overrides = ((ComponentAuditingData) this.auditedPropertiesHolder).getAuditingOverrides(); for (AuditOverride override : overrides) { if (property.getName().equals(override.name())) { // the override applies to this property if (!override.isAudited()) { return false; } else { if (override.auditJoinTable() != null) { propertyData.setJoinTable(override.auditJoinTable()); } } } } } return true; }