If you use targetAuditMode=RelationTargetAuditMode.NOT_AUDITED on a relation and delete the (non-audited) target entity, queries for audits that contain links to the deleted target entity will throw an exception. Where it is thrown depends on how the source entity is implemented: if it implements hashCode() and includes the target entity in the hash, it'll be deep within the query itself.
Here's a concrete example:
Now suppose we issue three transactions:
Transaction 1 creates and persists a Foo and a Bar.
Transaction 2 deletes both the Foo and the Bar.
Transaction 3 queries for all revisions.
The query will throw an exception like so:
It would be nice to fail gracefully in the face of non-existent entity targets, by nullifying the relation, perhaps.