blaze-persistence
blaze-persistence copied to clipboard
Relax "no fetches allowed" restriction when querying updatable entity views
Applying an EntityViewSetting with non-empty fetches
to a CriteriaBuilder
instance leads to this error:
Specifying fetches for @UpdatableEntityViews is currently disallowed. Remove the fetches!
The reason behind this is probably that the dirty tracking mechanism cannot work with partially populated entity views.
The use case here, though, is not to mutate the entity (view) but simply fetch it using an available view definition (which happens to be updatable).
The suggested behavior is to flag partially populated EVs and to throw an error only if such flagged EVs are to be saved/updated.