mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-10 15:32:05 -03:30
* [Docs] Additional datasources support Closes #40388 Closes #42263 Co-authored-by: Václav Muzikář <vaclav@muzikari.cz> Signed-off-by: Martin Bartoš <mabartos@redhat.com> * Rename namedKey to wildcardKey in the code Signed-off-by: Martin Bartoš <mabartos@redhat.com> * Clarify the defaults for DB kind Signed-off-by: Martin Bartoš <mabartos@redhat.com> * Be more clear about the Named key reference in guide Signed-off-by: Martin Bartoš <mabartos@redhat.com> * Vasek's review Signed-off-by: Martin Bartoš <mabartos@redhat.com> --------- Signed-off-by: Martin Bartoš <mabartos@redhat.com> Co-authored-by: Václav Muzikář <vaclav@muzikari.cz>
14 lines
739 B
Plaintext
14 lines
739 B
Plaintext
|
|
=== Accessing the new entity manager
|
|
|
|
In order to simply access your data in your {project_name} extension, you can obtain the link:https://jakarta.ee/specifications/persistence/3.2/apidocs/jakarta.persistence/jakarta/persistence/entitymanager[EntityManager] for the additional datasources used in these quickstarts.
|
|
It helps you to interact with entities specified for your datasource, as it provides some kind of bridge between your JPA entities and the database.
|
|
|
|
You can use the new entity manager (for the `user-store` datasource) as follows:
|
|
|
|
[source,java]
|
|
----
|
|
EntityManager em = session.getProvider(JpaConnectionProvider.class, "user-store").getEntityManager();
|
|
var user = em.find(org.your.extension.UserEntity.class, 123L);
|
|
----
|