Interface ExchangeRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Exchange,Long>, org.springframework.data.jpa.repository.JpaRepository<Exchange,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<Exchange>, org.springframework.data.repository.ListCrudRepository<Exchange,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<Exchange,Long>, org.springframework.data.repository.PagingAndSortingRepository<Exchange,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Exchange>, org.springframework.data.repository.Repository<Exchange,Long>

@Repository public interface ExchangeRepository extends org.springframework.data.jpa.repository.JpaRepository<Exchange,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<Exchange>
Data-access layer for Exchange.
Version:
3.0.6
Author:
Stephen Prizio
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor

    org.springframework.data.jpa.repository.JpaSpecificationExecutor.SpecificationFluentQuery<T>
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an Exchange for the given MIC.
    int
    upsertExchange(String mic, String name, String operator, String city, String country, String timezone, String currency, String tradingHours)
    Inserts or updates an existing Exchange.

    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, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

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

    count, count, delete, delete, exists, exists, findAll, findAll, findAll, findAll, findAll, findBy, findBy, findOne, findOne, update

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

    findAll, findAllById, saveAll

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

    findAll

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

    findAll

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

    count, exists, findAll, findBy, findOne
  • Method Details

    • findExchangeByMicIgnoreCase

      @Query("SELECT e FROM Exchange e WHERE LOWER(e.mic) = LOWER(:mic)") Exchange findExchangeByMicIgnoreCase(@Param("mic") String mic)
      Returns an Exchange for the given MIC.
      Parameters:
      mic - exchange MIC
      Returns:
      Exchange
    • upsertExchange

      @Modifying(flushAutomatically=true) @Transactional @Query(value=" INSERT INTO exchanges (\n mic,\n name,\n exchange_operator,\n city,\n country,\n timezone,\n currency,\n trading_hours\n )\n VALUES (\n :mic,\n :name,\n :operator,\n :city,\n :country,\n :timezone,\n :currency,\n :tradingHours\n )\n ON CONFLICT (mic)\n DO UPDATE SET\n name = EXCLUDED.name,\n exchange_operator = EXCLUDED.exchange_operator,\n city = EXCLUDED.city,\n country = EXCLUDED.country,\n timezone = EXCLUDED.timezone,\n currency = EXCLUDED.currency,\n trading_hours = EXCLUDED.trading_hours,\n modified_at = GREATEST(\n exchanges.created_at,\n clock_timestamp() AT TIME ZONE 'UTC'\n )\n WHERE\n exchanges.name IS DISTINCT FROM EXCLUDED.name\n OR exchanges.exchange_operator IS DISTINCT FROM EXCLUDED.exchange_operator\n OR exchanges.city IS DISTINCT FROM EXCLUDED.city\n OR exchanges.country IS DISTINCT FROM EXCLUDED.country\n OR exchanges.timezone IS DISTINCT FROM EXCLUDED.timezone\n OR exchanges.currency IS DISTINCT FROM EXCLUDED.currency\n OR exchanges.trading_hours IS DISTINCT FROM EXCLUDED.trading_hours\n", nativeQuery=true) int upsertExchange(@Param("mic") String mic, @Param("name") String name, @Param("operator") String operator, @Param("city") String city, @Param("country") String country, @Param("timezone") String timezone, @Param("currency") String currency, @Param("tradingHours") String tradingHours)
      Inserts or updates an existing Exchange.
      Parameters:
      mic - exchange MIC
      name - exchange name
      operator - operator
      city - city
      country - country code
      timezone - timezone
      currency - currency code
      tradingHours - trading hours
      Returns:
      number of entries inserted or updated