Attribute access is checked before beforeDetachListener

Hi,

We have a parent/embedded relationship on an entity (transient attribute on embedded entity). We implement beforeDetachListener on parent entity to assign a value to this attribute.

We have to check access to attribute on its state so we implement SetupAttributeAccessHandler. We need the relationship to setup access but, on load, access is checked before beforeDetachListener is executed so this attribute is always null.

Why does CUBA setup access before the entity is entirely valued ?

Regards, Stef.

PS: No problem with @PostLoad but you don’t recommend to use it: @PostLoad not working after 6.5 upgrade

Hi Stef,

Maybe it’s a mistake, but we cannot change the order in CUBA patches, because it’s not a critical problem and it may break an existing code behavior.

Perhaps you can find a workaround by rewriting your SetupAttributeAccessHandler in a way that it counts on the unassigned attribute.

Regards,
Konstantin

It’s a shame but thank you for your response.