I recently found this method, which might be useful for this: {{ javax.persistence.spi.PersistenceProviderResolverHolder#setPersistenceProviderResolver}}
At least we could make sure to try the OGM provider before the ORM one.