Class IdentityDAOImpl

java.lang.Object
org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<IdentityEntity, Long>
org.exoplatform.social.core.jpa.storage.dao.jpa.IdentityDAOImpl
All Implemented Interfaces:
org.exoplatform.commons.api.persistence.GenericDAO<IdentityEntity, Long>, IdentityDAO

public class IdentityDAOImpl extends org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<IdentityEntity, Long> implements IdentityDAO
  • Constructor Details

    • IdentityDAOImpl

      public IdentityDAOImpl()
  • Method Details

    • create

      public IdentityEntity create(IdentityEntity entity)
      Specified by:
      create in interface org.exoplatform.commons.api.persistence.GenericDAO<IdentityEntity, Long>
      Overrides:
      create in class org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<IdentityEntity, Long>
    • findByProviderAndRemoteId

      public IdentityEntity findByProviderAndRemoteId(String providerId, String remoteId)
      Specified by:
      findByProviderAndRemoteId in interface IdentityDAO
    • findIdByProviderAndRemoteId

      public Long findIdByProviderAndRemoteId(String providerId, String remoteId)
      Specified by:
      findIdByProviderAndRemoteId in interface IdentityDAO
    • countIdentityByProvider

      public long countIdentityByProvider(String providerId)
      Specified by:
      countIdentityByProvider in interface IdentityDAO
    • getAllIds

      public List<Long> getAllIds(int offset, int limit)
      Specified by:
      getAllIds in interface IdentityDAO
    • getAllIdsByProvider

      public List<Long> getAllIdsByProvider(String providerId, int offset, int limit)
      Specified by:
      getAllIdsByProvider in interface IdentityDAO
    • getEnabledRemoteIdsAfter

      public List<String> getEnabledRemoteIdsAfter(String providerId, boolean internalsOnly, String afterRemoteId, int limit)
      Specified by:
      getEnabledRemoteIdsAfter in interface IdentityDAO
      Parameters:
      providerId - the identity provider
      internalsOnly - whether the identities marked external are left out
      afterRemoteId - the remote id after which the list starts, excluded, or null to start from the first one
      limit - the maximum number of remote ids returned, 0 for all
      Returns:
      the remote ids of the enabled, non-deleted identities of a provider, in ascending remote id order — keyset iteration over the provider's unique remote ids
    • getDisabledIdsByProviderAfterId

      public List<Long> getDisabledIdsByProviderAfterId(String providerId, long lastId, int limit)
      Specified by:
      getDisabledIdsByProviderAfterId in interface IdentityDAO
      Parameters:
      providerId - the identity provider
      lastId - the id after which the page starts, excluded
      limit - the page size, 0 or less for no limit
      Returns:
      the non-deleted disabled identity ids of the provider strictly greater than lastId, in ascending id order
    • getIdsHoldingPropertyAfterId

      public List<Long> getIdsHoldingPropertyAfterId(String providerId, String propertyName, long lastId, int limit)
      Specified by:
      getIdsHoldingPropertyAfterId in interface IdentityDAO
      Parameters:
      providerId - the identity provider
      propertyName - the name of a profile property
      lastId - the id after which the page starts, excluded
      limit - the page size, 0 or less for no limit
      Returns:
      the non-deleted identity ids of the provider, disabled ones included, that hold a value for the property (a multi-valued property's values are one stored row), strictly greater than lastId, in ascending id order
    • getIdsByProviderAfterId

      public List<Long> getIdsByProviderAfterId(String providerId, long lastId, int limit)
      Specified by:
      getIdsByProviderAfterId in interface IdentityDAO
      Returns:
      the non-deleted identity ids of a provider strictly greater than lastId, disabled ones included, in ascending id order — keyset iteration that never skips a row even when identities are soft-deleted while iterating
    • findAllIdentitiesWithConnections

      public org.exoplatform.commons.utils.ListAccess<Map.Entry<IdentityEntity, ConnectionEntity>> findAllIdentitiesWithConnections(long identityId, String sortField, String sortDirection)
      Specified by:
      findAllIdentitiesWithConnections in interface IdentityDAO
    • findIdentities

      public org.exoplatform.commons.utils.ListAccess<IdentityEntity> findIdentities(ExtendProfileFilter filter)
      Specified by:
      findIdentities in interface IdentityDAO
    • getAllIdsByProviderSorted

      public List<String> getAllIdsByProviderSorted(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, List<String> groupIds, String membershipType, boolean includeInheritedMemberships, long offset, long limit)
      Specified by:
      getAllIdsByProviderSorted in interface IdentityDAO
    • getIdentityIdsByProviderSorted

      public List<Long> getIdentityIdsByProviderSorted(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, List<String> groupIds, String membershipType, boolean includeInheritedMemberships, long offset, long limit)
      Specified by:
      getIdentityIdsByProviderSorted in interface IdentityDAO
    • getAllIdsCountByProvider

      public int getAllIdsCountByProvider(String providerId, String userType, Boolean isConnected, boolean isEnabled, String enrollmentStatus, List<String> remoteIds, List<String> groupIds, String membershipType, boolean includeInheritedMemberships)
      Specified by:
      getAllIdsCountByProvider in interface IdentityDAO
    • setAsDeleted

      public void setAsDeleted(long identityId)
      Description copied from interface: IdentityDAO
      set the DELETED flag to true
      Specified by:
      setAsDeleted in interface IdentityDAO
      Parameters:
      identityId - the identity Id
    • hardDeleteIdentity

      public void hardDeleteIdentity(long identityId)
      Description copied from interface: IdentityDAO
      delete definitely an identity
      Specified by:
      hardDeleteIdentity in interface IdentityDAO
      Parameters:
      identityId - the identity Id
    • findIdentitiesByIDs

      public List<IdentityEntity> findIdentitiesByIDs(List<Long> ids)
    • getFromOracleDB

      public <T> List<T> getFromOracleDB(jakarta.persistence.TypedQuery<T> query, List<Long> ids)
      in ORACLE, maximum number of expressions in a list is 1000. so we need to send more than one request if the number of ids is more than 1000 (1000 ids per request).
      Type Parameters:
      T - This is the type parameter
      Parameters:
      query - The query.
      ids - The ids of users.
      Returns: