Class JpaMapStorage<RE extends JpaRootEntity,E extends AbstractEntity,M>
- java.lang.Object
-
- org.keycloak.models.map.storage.jpa.JpaMapStorage<RE,E,M>
-
- All Implemented Interfaces:
MapStorage<E,M>
- Direct Known Subclasses:
JpaAdminEventMapStorage,JpaAuthEventMapStorage,JpaClientMapStorage,JpaClientScopeMapStorage,JpaGroupMapStorage,JpaLockMapStorage,JpaPermissionMapStorage,JpaPolicyMapStorage,JpaRealmMapStorage,JpaResourceMapStorage,JpaResourceServerMapStorage,JpaRoleMapStorage,JpaRootAuthenticationSessionMapStorage,JpaScopeMapStorage,JpaSingleUseObjectMapStorage,JpaUserLoginFailureMapStorage,JpaUserMapStorage,JpaUserSessionMapStorage
public abstract class JpaMapStorage<RE extends JpaRootEntity,E extends AbstractEntity,M> extends Object implements MapStorage<E,M>
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.persistence.EntityManagerem
-
Constructor Summary
Constructors Constructor Description JpaMapStorage(org.keycloak.models.KeycloakSession session, Class<RE> entityType, Class<M> modelType, javax.persistence.EntityManager em)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static voidclearQueryCache(org.hibernate.Session session)Ecreate(E mapEntity)protected abstract JpaModelCriteriaBuildercreateJpaModelCriteriaBuilder()booleandelete(String key)longdelete(QueryParameters<M> queryParameters)longgetCount(QueryParameters<M> queryParameters)protected abstract EmapToEntityDelegate(RE original)protected EmapToEntityDelegateUnique(RE original)Use the cache within the session to ensure that there is only one instance per entity within the current session.Eread(String key)Stream<E>read(QueryParameters<M> queryParameters)protected voidremoveFromCache(String key)protected abstract javax.persistence.criteria.Selection<? extends RE>selectCbConstruct(javax.persistence.criteria.CriteriaBuilder cb, javax.persistence.criteria.Root<RE> root)protected abstract voidsetEntityVersion(JpaRootEntity entity)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.keycloak.models.map.storage.MapStorage
exists, exists
-
-
-
-
Method Detail
-
selectCbConstruct
protected abstract javax.persistence.criteria.Selection<? extends RE> selectCbConstruct(javax.persistence.criteria.CriteriaBuilder cb, javax.persistence.criteria.Root<RE> root)
-
setEntityVersion
protected abstract void setEntityVersion(JpaRootEntity entity)
-
createJpaModelCriteriaBuilder
protected abstract JpaModelCriteriaBuilder createJpaModelCriteriaBuilder()
-
mapToEntityDelegateUnique
protected E mapToEntityDelegateUnique(RE original)
Use the cache within the session to ensure that there is only one instance per entity within the current session.
-
create
public E create(E mapEntity)
- Specified by:
createin interfaceMapStorage<RE extends JpaRootEntity,E extends AbstractEntity>
-
read
public E read(String key)
- Specified by:
readin interfaceMapStorage<RE extends JpaRootEntity,E extends AbstractEntity>
-
read
public Stream<E> read(QueryParameters<M> queryParameters)
- Specified by:
readin interfaceMapStorage<RE extends JpaRootEntity,E extends AbstractEntity>
-
clearQueryCache
public static void clearQueryCache(org.hibernate.Session session)
-
getCount
public long getCount(QueryParameters<M> queryParameters)
- Specified by:
getCountin interfaceMapStorage<RE extends JpaRootEntity,E extends AbstractEntity>
-
delete
public boolean delete(String key)
- Specified by:
deletein interfaceMapStorage<RE extends JpaRootEntity,E extends AbstractEntity>
-
removeFromCache
protected void removeFromCache(String key)
-
delete
public long delete(QueryParameters<M> queryParameters)
- Specified by:
deletein interfaceMapStorage<RE extends JpaRootEntity,E extends AbstractEntity>
-
-