Interface CountryRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Country,CountryId>, org.springframework.data.jpa.repository.JpaRepository<Country,CountryId>, org.springframework.data.repository.PagingAndSortingRepository<Country,CountryId>, org.springframework.data.repository.query.QueryByExampleExecutor<Country>, org.springframework.data.repository.Repository<Country,CountryId>

public interface CountryRepository extends org.springframework.data.jpa.repository.JpaRepository<Country,CountryId>
The CountryRepository interface declares the repository for the Country domain type.
Author:
Marcus Portmann
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieve all the countries sorted by locale ID, sort index, and name.
    Retrieve the countries for the specified locale sorted by locale ID, sort index, and name.

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

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

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

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAllById, flush, getById, getOne, saveAll, saveAllAndFlush, saveAndFlush

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

    findAll

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

    count, exists, findAll, findOne
  • Method Details

    • findAll

      @Query("select c from Country c order by c.localeId, -c.sortIndex DESC, c.shortName") List<Country> findAll()
      Retrieve all the countries sorted by locale ID, sort index, and name.
      Specified by:
      findAll in interface org.springframework.data.repository.CrudRepository<Country,CountryId>
      Specified by:
      findAll in interface org.springframework.data.jpa.repository.JpaRepository<Country,CountryId>
      Returns:
      all the countries sorted by locale ID, sort index, and name.
    • findByLocaleIdIgnoreCase

      @Query("select c from Country c where upper(c.localeId) = upper(:localeId) order by c.localeId, -c.sortIndex DESC, c.shortName") List<Country> findByLocaleIdIgnoreCase(String localeId)
      Retrieve the countries for the specified locale sorted by locale ID, sort index, and name.
      Parameters:
      localeId - the Unicode locale identifier for the locale to retrieve the countries for
      Returns:
      the countries for the specified locale sorted by locale ID, sort index, and name