Package org.silverpeas.components.community.repository

## Class CommunityOfUsersJpaRepository

- java.lang.Object
- - org.silverpeas.core.persistence.datasource.repository.jpa.AbstractJpaEntityRepository<E>
  - - org.silverpeas.core.persistence.datasource.repository.jpa.BasicJpaEntityRepository<CommunityOfUsers>
    - - org.silverpeas.components.community.repository.CommunityOfUsersJpaRepository

- All Implemented Interfaces:
    `CommunityOfUsersRepository`, `org.silverpeas.core.persistence.datasource.repository.EntityRepository<CommunityOfUsers>`, `org.silverpeas.core.persistence.datasource.repository.WithSaveAndFlush<CommunityOfUsers>`

      @Repository
      public class CommunityOfUsersJpaRepository
      extends org.silverpeas.core.persistence.datasource.repository.jpa.BasicJpaEntityRepository<CommunityOfUsers>
      implements CommunityOfUsersRepository

  Implementation of the repository of Community of users by extending the `BasicJpaEntityRepository` 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.

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `List<CommunityOfUsers>` | `getAllByUserId​(String userId)` | Gets all the community of users the specified user is currently a member.
    `Optional<CommunityOfUsers>` | `getByComponentInstanceId​(String componentInstanceId)` | Gets the community of users managed by the specified component instance.
    `Optional<CommunityOfUsers>` | `getBySpaceId​(String spaceId)` | Gets the community of users of the specified collaborative space.

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

      `deleteByComponentInstanceId, saveAndFlush`

    - ### 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.core.persistence.datasource.repository.EntityRepository

      `contains, delete, delete, deleteByComponentInstanceId, deleteById, deleteById, findByCriteria, flush, getAll, getById, getById, getById, save, save, save`

- - ### Constructor Detail

    - #### CommunityOfUsersJpaRepository

          public CommunityOfUsersJpaRepository()

  - ### Method Detail

    - #### getByComponentInstanceId

          public Optional<CommunityOfUsers> getByComponentInstanceId​(String componentInstanceId)

      Description copied from interface: `CommunityOfUsersRepository`
      Gets the community of users managed by the specified component instance.
      Specified by:
        `getByComponentInstanceId` in interface `CommunityOfUsersRepository`
      Parameters:
        `componentInstanceId` - the unique identifier of a component instance.
      Returns:
        an `Optional` with the `CommunityOfUsers` instance or an empty `Optional` if no such component instance exists.

    - #### getBySpaceId

          public Optional<CommunityOfUsers> getBySpaceId​(String spaceId)

      Description copied from interface: `CommunityOfUsersRepository`
      Gets the community of users of the specified collaborative space.
      Specified by:
        `getBySpaceId` in interface `CommunityOfUsersRepository`
      Parameters:
        `spaceId` - the unique identifier of a space.
      Returns:
        an `Optional` with the `CommunityOfUsers` instance or an empty `Optional` if no such space exists or if the space doesn't have any community.

    - #### getAllByUserId

          public List<CommunityOfUsers> getAllByUserId​(String userId)

      Description copied from interface: `CommunityOfUsersRepository`
      Gets all the community of users the specified user is currently a member.
      Specified by:
        `getAllByUserId` in interface `CommunityOfUsersRepository`
      Parameters:
        `userId` - the unique identifier of a user.
      Returns:
        a list of communities to which the given user is a member.