Interface AddressRepository

  • All Superinterfaces:
    org.springframework.data.repository.CrudRepository<Address,​java.lang.String>, org.springframework.data.mongodb.repository.MongoRepository<Address,​java.lang.String>, org.springframework.data.repository.PagingAndSortingRepository<Address,​java.lang.String>, org.springframework.data.repository.query.QueryByExampleExecutor<Address>, org.springframework.data.repository.Repository<Address,​java.lang.String>

    @Repository
    public interface AddressRepository
    extends org.springframework.data.mongodb.repository.MongoRepository<Address,​java.lang.String>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.Optional<Address> findAddress​(java.lang.String postalCode, java.lang.String street, java.lang.String houseNumber, java.lang.String city, java.lang.String countryId)  
      java.util.Optional<Address> findAddressIgnoreCase​(java.lang.String postalCode, java.lang.String street, java.lang.String houseNumber, java.lang.String city, java.lang.String countryCode)  
      java.util.List<Address> findByCountryCode​(java.lang.String countryCode)  
      java.util.Optional<Address> findById​(java.lang.String id)  
      org.springframework.data.domain.Page<Address> search​(java.lang.String query, org.springframework.data.domain.Pageable page)  
      • Methods inherited from interface org.springframework.data.repository.CrudRepository

        count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAllById, save
      • Methods inherited from interface org.springframework.data.mongodb.repository.MongoRepository

        findAll, findAll, findAll, findAll, insert, insert, saveAll
      • 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 Detail

      • findById

        java.util.Optional<Address> findById​(java.lang.String id)
        Specified by:
        findById in interface org.springframework.data.repository.CrudRepository<Address,​java.lang.String>
      • findByCountryCode

        java.util.List<Address> findByCountryCode​(java.lang.String countryCode)
      • findAddress

        @Query("{\'postalCode\': ?0, \'street\' : ?1, \'houseNumber\' : ?2, \'city\' : ?3, \'country.code\' : ?4}")
        java.util.Optional<Address> findAddress​(java.lang.String postalCode,
                                                java.lang.String street,
                                                java.lang.String houseNumber,
                                                java.lang.String city,
                                                java.lang.String countryId)
      • findAddressIgnoreCase

        @Query("{\'postalCode\': {$regex:?0,$options:\'i\'}, \'street\' : {$regex:?1,$options:\'i\'}, \'houseNumber\' : {$regex:?2,$options:\'i\'}, \'city\' : {$regex:?3,$options:\'i\'}, \'country.code\' : {$regex:?4,$options:\'i\'} }")
        java.util.Optional<Address> findAddressIgnoreCase​(java.lang.String postalCode,
                                                          java.lang.String street,
                                                          java.lang.String houseNumber,
                                                          java.lang.String city,
                                                          java.lang.String countryCode)
      • search

        @Query("{ $or: [ { \'postalCode\' : {$regex:?0,$options:\'i\'} },{ \'street\' : {$regex:?0,$options:\'i\'} },{ \'houseNumber\' : {$regex:?0,$options:\'i\'} },{ \'city\' : {$regex:?0,$options:\'i\'} } ] }")
        org.springframework.data.domain.Page<Address> search​(java.lang.String query,
                                                             org.springframework.data.domain.Pageable page)