I have also decided to add the following configuration setting:
/**
* Globally specifies whether to gracefully handle missing to-one relations.
* Defaults to {@code true}.
*
* By specifying this flag as {@code false}, you restore legacy behavior without having to
* change all your {@code Audited} annotations which use this feature by default.
*
* @since 6.0
*/
String GLOBAL_RELATION_NOT_FOUND_FLAG = "org.hibernate.envers.global_relation_not_found_flag";
By default, Envers will assume the IGNORE behavior. This means any @Audited to-one property will be handled to be ignored if not found. But some users may prefer the legacy behavior without having to modify all their @Audited annotations and rather be explicit about the cases where they'd like IGNORE to be used. For those situations, users can set this global configuration to false to invert the default behavior to do precisely that. |