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 |
protected static org.slf4j.Logger |
logger
The logger |
Constructor Summary |
ZipCodeDao()
Default constructor |
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 |
logger
protected static final org.slf4j.Logger logger
- The logger
ZipCodeDao
public ZipCodeDao()
- Default constructor
getByCodeAndCountry
public List<ZipCode> getByCodeAndCountry(String code,
String countryCode)
- Specified by:
getByCodeAndCountry
in interface IZipCodeDao
- Parameters:
code
- the zipcode to searchcountryCode
- 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 searchcountryCode
- 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 © 2012. All Rights Reserved.