com.gisgraphy.domain.repository

## Class CityDao

- java.lang.Object
- - org.springframework.dao.support.DaoSupport
  - - org.springframework.orm.hibernate3.support.HibernateDaoSupport
    - - com.gisgraphy.domain.repository.GenericDao<T,Long>
      - - com.gisgraphy.domain.repository.GenericGisDao<City>
        - - com.gisgraphy.domain.repository.CityDao

- All Implemented Interfaces:
    ICityDao, IDao<City,Long>, IGisDao<City>, org.springframework.beans.factory.InitializingBean

      @Repository
      public class CityDao
      extends GenericGisDao<City>
      implements ICityDao

  A data access object for `City`
  Author:
    David Masclet

- - ### Field Summary

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

      `GEOMETRY_TYPE, MAX_FULLTEXT_RESULTS`

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

      `persistentClass`

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

      `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CityDao()` Default constructor

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `City` | `getByShape(com.vividsolutions.jts.geom.Point location, String countryCode, boolean filterMunicipality)`
    `List<City>` | `listByZipCode(String zipcode, String countrycode)`

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

      `createGISTIndexForLocationColumn, createGISTIndexForShapeColumn, deleteAll, deleteAll, getByFeatureId, getDirties, getEager, getNearest, getNearestAndDistanceFrom, getNearestAndDistanceFrom, getNearestAndDistanceFrom, getNearestAndDistanceFromGisFeature, getNearestAndDistanceFromGisFeature, getShapeAsWKTByFeatureId, listByFeatureIds, listByName, listFromText, listFromText, remove, save, setEventManager`

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

      `count, exists, flushAndClear, get, getAll, getAllPaginate, getPersistenceClass, 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.IGisDao

      `createGISTIndexForLocationColumn, createGISTIndexForShapeColumn, getByFeatureId, getDirties, getEager, getNearest, getNearestAndDistanceFrom, getNearestAndDistanceFrom, getNearestAndDistanceFromGisFeature, getNearestAndDistanceFromGisFeature, getShapeAsWKTByFeatureId, listByFeatureIds, listByName, listFromText`

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

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

- - ### Constructor Detail

    - #### CityDao

          public CityDao()

      Default constructor

  - ### Method Detail

    - #### listByZipCode

          public List<City> listByZipCode(String zipcode,
                                 String countrycode)

      Specified by:
        `listByZipCode` in interface `ICityDao`
      Parameters:
        `zipcode` - the zipcode to found
        `countrycode` - the countrycode to limit the search, if null: search in all country
      Returns:
        A list a city for the specified parameters, if countrycode is specified, the list should have one city. To search for name or zip code use : `GenericGisDao.listFromText(String, boolean)`.

    - #### getByShape

          public City getByShape(com.vividsolutions.jts.geom.Point location,
                        String countryCode,
                        boolean filterMunicipality)

      Specified by:
        `getByShape` in interface `ICityDao`
      Returns:
        the city that the given point belongs by searching by shape. the countrycode is optionnal we can filter the result if the city is a municipality or not

Copyright © 2015. All rights reserved.