I developed a custom JpaEntityProvider and deployed this as an archive to a running Keycloak instance. The custom entity doesn’t get loaded until I restart the server, because it’s only added to the persistenceUnit upon creation of the EntityManagerFactory, which happens only on boot.
Thanks @xgp. As suggested in the Jira ticket, I solved it by installing the JpaEntityProvider as a module as described in the docs.
In my particular case, I have a separate jar for the JpaEntityProvider only. Because I like hot deploying, I keep my other SPI’s in another jar and deploy them via an ear.