com.gisgraphy.domain.repository

## Class ZipCodeDao

- java.lang.Object
- - org.springframework.dao.support.DaoSupport
  - - org.springframework.orm.hibernate3.support.HibernateDaoSupport
    - - com.gisgraphy.domain.repository.GenericDao<ZipCode,Long>
      - - com.gisgraphy.domain.repository.ZipCodeDao

- All Implemented Interfaces:
    IDao<ZipCode,Long>, IZipCodeDao, org.springframework.beans.factory.InitializingBean

      @Repository
      public class ZipCodeDao
      extends GenericDao<ZipCode,Long>
      implements IZipCodeDao

  A data access object for `ZipCode` Object
  Author:
    David Masclet

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.slf4j.Logger` | `logger` The logger

    - ### Fields inherited from class com.gisgraphy.domain.repository.GenericDao

      `persistentClass`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ZipCodeDao()` Default constructor

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<ZipCode>` | `getByCodeAndCountry(String code, String countryCode)`
    `List<ZipCode>` | `getByCodeAndCountrySmart(String code, String countryCode)` same as `IZipCodeDao.getByCodeAndCountry(String, String)` but do a starts with method if country is GB or CA
    `List<ZipCode>` | `listByCode(String code)`

    - ### Methods inherited from class com.gisgraphy.domain.repository.GenericDao

      `count, deleteAll, deleteAll, exists, flushAndClear, get, getAll, getAllPaginate, getPersistenceClass, remove, save, setFlushMode`

    - ### Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport

      `checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory`

    - ### Methods inherited from class org.springframework.dao.support.DaoSupport

      `afterPropertiesSet, initDao`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.gisgraphy.domain.repository.IDao

      `count, deleteAll, deleteAll, exists, flushAndClear, get, getAll, getAllPaginate, getPersistenceClass, remove, save, setFlushMode`

- - ### Field Detail

    - #### logger

          protected static final org.slf4j.Logger logger

      The logger

  - ### Constructor Detail

    - #### ZipCodeDao

          public ZipCodeDao()

      Default constructor

  - ### Method Detail

    - #### getByCodeAndCountry

          public List<ZipCode> getByCodeAndCountry(String code,
                                          String countryCode)

      Specified by:
        `getByCodeAndCountry` in interface `IZipCodeDao`
      Parameters:
        `code` - the zipcode to search
        `countryCode` - The ISO 3166 Alpha 2 code in upper case
      Returns:
        the zipcode

    - #### getByCodeAndCountrySmart

          public List<ZipCode> getByCodeAndCountrySmart(String code,
                                               String countryCode)

      Description copied from interface: `IZipCodeDao`
      same as `IZipCodeDao.getByCodeAndCountry(String, String)` but do a starts with method if country is GB or CA
      Specified by:
        `getByCodeAndCountrySmart` in interface `IZipCodeDao`
      Parameters:
        `code` - the zipcode to search
        `countryCode` - The ISO 3166 Alpha 2 code in upper case
      Returns:
        the zipcode

    - #### listByCode

          public List<ZipCode> listByCode(String code)

      Specified by:
        `listByCode` in interface `IZipCodeDao`
      Parameters:
        `code` - The zipcode to search
      Returns:
        a list of all zipcode where the given code matches or an empty list if no result

Copyright © 2015. All rights reserved.