Interface MeasurementUnitRepository

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

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

    Modifier and Type
    Method
    Description
    Retrieve all the measurement units sorted by locale ID, sort index, and name.
    Retrieve the measurement units 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 mu from MeasurementUnit mu order by mu.localeId, -mu.sortIndex DESC, mu.system, mu.type, mu.name") List<MeasurementUnit> findAll()
      Retrieve all the measurement units sorted by locale ID, sort index, and name.
      Specified by:
      findAll in interface org.springframework.data.repository.CrudRepository<MeasurementUnit,MeasurementUnitId>
      Specified by:
      findAll in interface org.springframework.data.jpa.repository.JpaRepository<MeasurementUnit,MeasurementUnitId>
      Returns:
      all the measurement units sorted by locale ID, sort index, and name.
    • findByLocaleIdIgnoreCase

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