Use findById like this, This returns whole object not a proxy like getOne/getReferenceById
repository.findById(id).orElseThrow(() -> new ResourceNotFoundException("any message"));
Thank You !