What is the best way to add a new Entity to the model?

Hi everyone,

What is the best way to add a new Entity to the model and store it in the database? I would like to add a custom table with a column id that is autoincrement. Thanks in advance for your help.

I have found this: https://www.keycloak.org/docs/latest/server_development/index.html#_extensions_jpa I think is a good starting point.

as it not provide complete implementation detail could u provide more resource on it

I have an extension that provides a fairly simple example of adding an Entity and creating a provider that allows access to that Entity:

Most of the code is here: keycloak-events/src/main/java/io/phasetwo/keycloak/model at main · p2-inc/keycloak-events · GitHub
And the schema is defined here: keycloak-events/src/main/resources/META-INF at main · p2-inc/keycloak-events · GitHub

Thank u for the reference and resources