Package org.silverpeas.components.community.repository

## Class CommunityMembershipJpaRepository

- java.lang.Object
- - org.silverpeas.core.persistence.datasource.repository.jpa.AbstractJpaEntityRepository<E>
  - - org.silverpeas.core.persistence.datasource.repository.jpa.SilverpeasJpaEntityRepository<CommunityMembership>
    - - org.silverpeas.components.community.repository.CommunityMembershipJpaRepository

- All Implemented Interfaces:
    `CommunityMembershipRepository`, `org.silverpeas.core.persistence.datasource.repository.EntityRepository<CommunityMembership>`

      @Repository
      public class CommunityMembershipJpaRepository
      extends org.silverpeas.core.persistence.datasource.repository.jpa.SilverpeasJpaEntityRepository<CommunityMembership>
      implements CommunityMembershipRepository

  Implementation of the repository of members of communities of users by extending the `SilverpeasJpaEntityRepository` base repository that provides all the basic and necessary methods to save, to update, to delete and to get the business entities by using the JPA engine.
  Author:
    mmoquillon

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.silverpeas.components.community.repository.CommunityMembershipRepository

      `CommunityMembershipRepository.CommunityMembershipsTable`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `CommunityMembershipJpaRepository()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `long` | `deleteByComponentInstanceId​(String componentInstanceId)` | Deletes all the members of the community of users managed by the specified component instance.
    `CommunityMembershipRepository.CommunityMembershipsTable` | `getMembershipsTable​(CommunityOfUsers community)` | Gets the table of members of the specified community.

    - ### Methods inherited from class org.silverpeas.core.persistence.datasource.repository.jpa.AbstractJpaEntityRepository

      `contains, countByCriteria, countFromJpqlString, delete, deleteById, deleteFromJpqlQuery, deleteFromNamedQuery, findByCriteria, findByNamedQuery, findFirstByNamedQuery, flush, getAll, getById, getById, getEntityClass, getEntityManager, getFromJpqlString, getFromJpqlString, getFromNamedQuery, getFromNamedQuery, getIdentifierConverter, getMaximumItemsInClause, listFromJpqlString, listFromJpqlString, listFromJpqlString, listFromJpqlString, listFromNamedQuery, listFromNamedQuery, newNamedParameters, noParameter, save, setMaximumItemsInClause, split, streamByNamedQuery, streamByNamedQuery, streamFromJpqlString, streamFromJpqlString, updateFromJpqlQuery, updateFromNamedQuery`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.silverpeas.components.community.repository.CommunityMembershipRepository

      `delete, delete, deleteById, deleteById, getAll`

    - ### Methods inherited from interface org.silverpeas.core.persistence.datasource.repository.EntityRepository

      `contains, findByCriteria, flush, getById, getById, getById, save, save, save`

- - ### Constructor Detail

    - #### CommunityMembershipJpaRepository

          public CommunityMembershipJpaRepository()

  - ### Method Detail

    - #### getMembershipsTable

          public CommunityMembershipRepository.CommunityMembershipsTable getMembershipsTable​(CommunityOfUsers community)

      Description copied from interface: `CommunityMembershipRepository`
      Gets the table of members of the specified community.
      Specified by:
        `getMembershipsTable` in interface `CommunityMembershipRepository`
      Parameters:
        `community` - a community of users.
      Returns:
        a `CommunityMembershipRepository.CommunityMembershipsTable` instance through which the members of the specified community can be requested.

    - #### deleteByComponentInstanceId

          public long deleteByComponentInstanceId​(String componentInstanceId)

      Description copied from interface: `CommunityMembershipRepository`
      Deletes all the members of the community of users managed by the specified component instance. The method has to be invoked only when the given component instance, and thus the community managed of users by it, is being deleted.
      Specified by:
        `deleteByComponentInstanceId` in interface `CommunityMembershipRepository`
      Specified by:
        `deleteByComponentInstanceId` in interface `org.silverpeas.core.persistence.datasource.repository.EntityRepository<CommunityMembership>`
      Overrides:
        `deleteByComponentInstanceId` in class `org.silverpeas.core.persistence.datasource.repository.jpa.SilverpeasJpaEntityRepository<CommunityMembership>`
      Parameters:
        `componentInstanceId` - the unique component instance identifier.
      Returns:
        the number of deleted members.
      See Also:
        `CommunityMembershipRepository.CommunityMembershipsTable.deleteAll()`