How do I check sandbox fields on an entity
You can access Sandbox (or ArchiveStatus) fields by casting the entity. For Sandbox fields:
if (product instanceof SandBoxDiscriminator) { // Cast the entity ((SandBoxDiscriminator) product).getSandBoxArchivedFlag() }
The same can be done for ArchiveStatus fields. Check if it is an instance, then cast it.