org.appng.core.repository

## Interface SiteRepository

- All Superinterfaces:
    org.springframework.data.repository.CrudRepository<SiteImpl,Integer>, org.springframework.data.jpa.repository.JpaRepository<SiteImpl,Integer>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<SiteImpl>, org.springframework.data.repository.PagingAndSortingRepository<SiteImpl,Integer>, org.springframework.data.repository.query.QueryByExampleExecutor<SiteImpl>, org.springframework.data.repository.Repository<SiteImpl,Integer>, SearchRepository<SiteImpl,Integer>

      public interface SiteRepository
      extends SearchRepository<SiteImpl,Integer>

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `SiteImpl` | `findByDomain(String domain)`
    `SiteImpl` | `findByHost(String host)`
    `SiteImpl` | `findByName(String name)`
    `List<SiteImpl>` | `findByNameIn(Iterable<String> siteNames)`
    `List<SiteImpl>` | `findSites()`
    `List<SiteImpl>` | `findSitesForApplication(Integer applicationId)`
    `List<SiteImpl>` | `findSitesForApplication(Integer applicationId, boolean active)`
    `List<SiteImpl>` | `findSitesForHostName(String hostName)`
    `List<SiteImpl>` | `findSitesForHostNames(Set<String> hostNames)`
    `List<Integer>` | `getSiteIds()`

    - ### Methods inherited from interface org.appng.persistence.repository.SearchRepository

      `createSearchQuery, detach, getHistory, getRevision, getRevisionNumber, isUnique, isUnique, search, search, search, search`

    - ### Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

      `deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAll, flush, getOne, save, saveAndFlush`

    - ### Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

      `findAll`

    - ### Methods inherited from interface org.springframework.data.repository.CrudRepository

      `count, delete, delete, delete, deleteAll, exists, findOne, save`

    - ### Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

      `count, exists, findAll, findOne`

    - ### Methods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor

      `count, findAll, findAll, findAll, findOne`

- - ### Method Detail

    - #### findByName

          SiteImpl findByName(String name)

    - #### findByHost

          SiteImpl findByHost(String host)

    - #### findByDomain

          SiteImpl findByDomain(String domain)

    - #### findSites

          @Query(value="select s from SiteImpl s")
          List<SiteImpl> findSites()

    - #### getSiteIds

          @Query(value="select s.id from SiteImpl s")
          List<Integer> getSiteIds()

    - #### findSitesForApplication

          @Query(value="select s from SiteImpl s join s.siteApplications p where p.application.id= ?1")
          List<SiteImpl> findSitesForApplication(Integer applicationId)

    - #### findSitesForApplication

          @Query(value="select s from SiteImpl s join s.siteApplications p where p.application.id= ?1 and s.active=?2")
          List<SiteImpl> findSitesForApplication(Integer applicationId,
                                                                                                                                                               boolean active)

    - #### findSitesForHostName

          @Query(value="select distinct s from SiteImpl s left join s.hostAliases a where s.host = ?1 or a = ?1")
          List<SiteImpl> findSitesForHostName(String hostName)

    - #### findSitesForHostNames

          @Query(value="select distinct s from SiteImpl s left join s.hostAliases a where s.host in (?1) or a in (?1)")
          List<SiteImpl> findSitesForHostNames(Set<String> hostNames)

    - #### findByNameIn

          List<SiteImpl> findByNameIn(Iterable<String> siteNames)

Copyright © 2011–2023 aiticon GmbH. All rights reserved.