Default resource id to 0 if the resource is not an entity