Package org.silverpeas.components.suggestionbox.repository

## Class SuggestionRepository

- java.lang.Object
- - org.silverpeas.components.suggestionbox.repository.SuggestionRepository

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

      @Repository
      public class SuggestionRepository
      extends Object
      implements org.silverpeas.core.persistence.datasource.repository.EntityRepository<Suggestion>

  This entity repository provides all necessary methods in order to handle the persistence of suggestion associated to suggestion boxes.
  Author:
    Yohann Chastagnier

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `contains​(Suggestion entity)` |
    `void` | `delete​(List<Suggestion> suggestions)` |
    `void` | `delete​(Suggestion... suggestions)` |
    `long` | `deleteById​(String... ids)` |
    `long` | `deleteById​(Collection<String> ids)` |
    `List<Suggestion>` | `findByCriteria​(SuggestionCriteria criteria)` | Finds suggestions according to the given suggestion criteria.
    `org.silverpeas.core.util.SilverpeasList<Suggestion>` | `findByCriteria​(org.silverpeas.core.persistence.datasource.repository.QueryCriteria criteria)` |
    `void` | `flush()` |
    `static SuggestionRepository` | `get()` |
    `org.silverpeas.core.util.SilverpeasList<Suggestion>` | `getAll()` |
    `Suggestion` | `getById​(String id)` |
    `org.silverpeas.core.util.SilverpeasList<Suggestion>` | `getById​(Collection<String> ids)` |
    `void` | `index​(Suggestion suggestion)` | Indexes the specified suggestion.
    `org.silverpeas.core.util.SilverpeasList<Suggestion>` | `save​(List<Suggestion> suggestions)` |
    `Suggestion` | `save​(Suggestion suggestion)` |
    `org.silverpeas.core.util.SilverpeasList<Suggestion>` | `save​(Suggestion... suggestions)` |

    - ### 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

      `deleteByComponentInstanceId, getById`

- - ### Constructor Detail

    - #### SuggestionRepository

          public SuggestionRepository()

  - ### Method Detail

    - #### get

          public static SuggestionRepository get()

    - #### findByCriteria

          public List<Suggestion> findByCriteria​(SuggestionCriteria criteria)

      Finds suggestions according to the given suggestion criteria.
      Parameters:
        `criteria` - the suggestion criteria.
      Returns:
        the suggestion list corresponding to the given suggestion criteria.

    - #### getAll

          public org.silverpeas.core.util.SilverpeasList<Suggestion> getAll()

      Specified by:
        `getAll` in interface `org.silverpeas.core.persistence.datasource.repository.EntityRepository<Suggestion>`

    - #### getById

          public Suggestion getById​(String id)

      Specified by:
        `getById` in interface `org.silverpeas.core.persistence.datasource.repository.EntityRepository<Suggestion>`

    - #### getById

          public org.silverpeas.core.util.SilverpeasList<Suggestion> getById​(Collection<String> ids)

      Specified by:
        `getById` in interface `org.silverpeas.core.persistence.datasource.repository.EntityRepository<Suggestion>`

    - #### findByCriteria

          public org.silverpeas.core.util.SilverpeasList<Suggestion> findByCriteria​(org.silverpeas.core.persistence.datasource.repository.QueryCriteria criteria)

      Specified by:
        `findByCriteria` in interface `org.silverpeas.core.persistence.datasource.repository.EntityRepository<Suggestion>`

    - #### save

          public Suggestion save​(Suggestion suggestion)

      Specified by:
        `save` in interface `org.silverpeas.core.persistence.datasource.repository.EntityRepository<Suggestion>`

    - #### save

          public org.silverpeas.core.util.SilverpeasList<Suggestion> save​(Suggestion... suggestions)

      Specified by:
        `save` in interface `org.silverpeas.core.persistence.datasource.repository.EntityRepository<Suggestion>`

    - #### save

          public org.silverpeas.core.util.SilverpeasList<Suggestion> save​(List<Suggestion> suggestions)

      Specified by:
        `save` in interface `org.silverpeas.core.persistence.datasource.repository.EntityRepository<Suggestion>`

    - #### delete

          public void delete​(Suggestion... suggestions)

      Specified by:
        `delete` in interface `org.silverpeas.core.persistence.datasource.repository.EntityRepository<Suggestion>`

    - #### delete

          public void delete​(List<Suggestion> suggestions)

      Specified by:
        `delete` in interface `org.silverpeas.core.persistence.datasource.repository.EntityRepository<Suggestion>`

    - #### deleteById

          public long deleteById​(String... ids)

      Specified by:
        `deleteById` in interface `org.silverpeas.core.persistence.datasource.repository.EntityRepository<Suggestion>`

    - #### deleteById

          public long deleteById​(Collection<String> ids)

      Specified by:
        `deleteById` in interface `org.silverpeas.core.persistence.datasource.repository.EntityRepository<Suggestion>`

    - #### flush

          public void flush()

      Specified by:
        `flush` in interface `org.silverpeas.core.persistence.datasource.repository.EntityRepository<Suggestion>`

    - #### contains

          public boolean contains​(Suggestion entity)

      Specified by:
        `contains` in interface `org.silverpeas.core.persistence.datasource.repository.EntityRepository<Suggestion>`

    - #### index

          public void index​(Suggestion suggestion)

      Indexes the specified suggestion. The suggestion validation must be at validated status. Otherwise, the index creation is ignored.
      Parameters:
        `suggestion` - the suggestion for which the indexation must be performed.