GEOMETRY_TYPE, MAX_FULLTEXT_RESULTS
persistentClass
Constructor and Description |
---|
AdmDao() |
Modifier and Type | Method and Description |
---|---|
long |
countByLevel(int level) |
int |
deleteAllByLevel(int level) |
Adm |
get(Long id)
Retrieve the Object whith the specified primary key
|
Adm |
getAdm(String countryCode,
String adm1Code,
String adm2Code,
String adm3Code,
String adm4Code)
Retrieve the Adm of the highest level according to the AdmXcode.
|
Adm |
getAdm1(String countryCode,
String adm1Code) |
Adm |
getAdm2(String countryCode,
String adm1Code,
String adm2Code) |
Adm |
getAdm3(String countryCode,
String adm1Code,
String adm2Code,
String adm3Code) |
Adm |
getAdm4(String countryCode,
String adm1Code,
String adm2Code,
String adm3Code,
String adm4Code) |
List<Adm> |
getAdmByCountryAndCodeAndLevel(String countryCode,
String admCode,
int level)
Returns The Adm with the specified code and the specified level for the
specified country code.
|
Adm |
getAdmOrFirstValidParentIfNotFound(String countryCode,
String adm1Code,
String adm2Code,
String adm3Code,
String adm4Code)
Return The Adm for the specified Code in the same way of
IAdmDao.getAdm(String, String, String, String, String) or the first
valid parent if no Adm is found with the specified codes. |
List<Adm> |
getAllbyLevel(int level) |
List<Adm> |
getDirties()
Returns inconsistant object (in most case object With featureid < 0)
|
List<Adm> |
getUnused() |
List<Long> |
listFeatureIdByLevel(int level)
List all the featureId of the Adms of a specified level
|
Adm |
save(Adm adm)
Check that codes are consistent according the level (see
Adm.isConsistentForLevel() and save it in the datastore |
Adm |
suggestMostAccurateAdm(String countryCode,
String adm1Code,
String adm2Code,
String adm3Code,
String adm4Code,
GisFeature gisfeature)
This method is used when
ImporterConfig.isTryToDetectAdmIfNotFound() is true or when error
correction is needed. the algorithm will return an Adm according the
specified rules:
If an Adm with the specified code is found (see
IAdmDao.getAdm(String, String, String, String, String) ) : retrun it
If an Adm with the highest not null level is found for the specified
country (e.g : if adm1,2,3 are specified and adm4 is null and it exist an
adm with level 3 for the specified adm3Code then it will be return)
If no parent Adm is found (see
IAdmDao.getAdmOrFirstValidParentIfNotFound(String, String, String, String, String) :
return Adm with the highest not null level
If a parent Adm is found (see
IAdmDao.getAdmOrFirstValidParentIfNotFound(String, String, String, String, String) :
If the difference beetween the Adm and The parent Adm is <=2 : we
assume that it is an error with only one code and return the Adm with the
highest not null level
If the difference is >1 we assume that there is too much error and
return the nearest parent
If No Adm with the highest not null level is found for the specified
country
If a parent Adm is found (see
IAdmDao.getAdmOrFirstValidParentIfNotFound(String, String, String, String, String) :
return Adm with the highest not null level : return the Parent
If no parent is found : return null
|
createGISTIndexForLocationColumn, createGISTIndexForShapeColumn, deleteAll, deleteAll, getByFeatureId, getEager, getNearest, getNearestAndDistanceFrom, getNearestAndDistanceFrom, getNearestAndDistanceFrom, getNearestAndDistanceFromGisFeature, getNearestAndDistanceFromGisFeature, getShapeAsWKTByFeatureId, listByFeatureIds, listByName, listFromText, listFromText, remove, setEventManager
count, exists, flushAndClear, getAll, getAllPaginate, getPersistenceClass, setFlushMode
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createGISTIndexForLocationColumn, createGISTIndexForShapeColumn, getByFeatureId, getEager, getNearest, getNearestAndDistanceFrom, getNearestAndDistanceFrom, getNearestAndDistanceFromGisFeature, getNearestAndDistanceFromGisFeature, getShapeAsWKTByFeatureId, listByFeatureIds, listByName, listFromText
count, deleteAll, deleteAll, exists, flushAndClear, getAll, getAllPaginate, getPersistenceClass, remove, setFlushMode
public Adm get(Long id)
IDao
public Adm save(Adm adm)
Adm.isConsistentForLevel()
and save it in the datastoresave
in interface IDao<Adm,Long>
save
in class GenericGisDao<Adm>
adm
- The Adm to saveAdm.isConsistentForLevel()
public Adm getAdm1(String countryCode, String adm1Code)
getAdm1
in interface IAdmDao
countryCode
- The country code of the Adm to retrieveadm1Code
- The Adm1Code of the Adm to retrieveIAdmDao.getAdm(String, String, String, String, String)
,
IAdmDao.getAdmByCountryAndCodeAndLevel(String, String, int)
public Adm getAdm2(String countryCode, String adm1Code, String adm2Code)
getAdm2
in interface IAdmDao
countryCode
- The country code of the Adm to retrieveadm1Code
- The Adm1Code of the Adm to retrieveadm2Code
- The Adm2Code of the Adm to retrieve NOTE : The
countryCode will be automaticaly converted in upperCaseIAdmDao.getAdm(String, String, String, String, String)
,
IAdmDao.getAdmByCountryAndCodeAndLevel(String, String, int)
public Adm getAdm3(String countryCode, String adm1Code, String adm2Code, String adm3Code)
getAdm3
in interface IAdmDao
countryCode
- The country code of the Adm to retrieveadm1Code
- The Adm1Code of the Adm to retrieveadm2Code
- The Adm2Code of the Adm to retrieveadm3Code
- The Adm3Code of the Adm to retrieve NOTE : The
countryCode will be automaticaly converted in upperCaseIAdmDao.getAdm(String, String, String, String, String)
,
IAdmDao.getAdmByCountryAndCodeAndLevel(String, String, int)
public Adm getAdm4(String countryCode, String adm1Code, String adm2Code, String adm3Code, String adm4Code)
getAdm4
in interface IAdmDao
countryCode
- The country code of the Adm to retrieveadm1Code
- The Adm1Code of the Adm to retrieveadm2Code
- The Adm2Code of the Adm to retrieveadm3Code
- The Adm3Code of the Adm to retrieveadm4Code
- The Adm4Code of the Adm to retrieve NOTE : The
countryCode will be automaticaly converted in upperCaseIAdmDao.getAdm(String, String, String, String, String)
public Adm getAdm(String countryCode, String adm1Code, String adm2Code, String adm3Code, String adm4Code)
IAdmDao
IAdmDao.getAdm1(String, String)
,
IAdmDao.getAdm2(String, String, String)
,
IAdmDao.getAdm3(String, String, String, String)
, and
IAdmDao.getAdm4(String, String, String, String, String)
. Use This
Method ONLY if you've got some AdmXcode and you don't know the Level.
you'll have better performance with the getAdmX() methods.getAdm
in interface IAdmDao
countryCode
- The country code of the Adm to retrieveadm1Code
- The Adm1Code of the Adm to retrieveadm2Code
- The Adm2Code of the Adm to retrieveadm3Code
- The Adm3Code of the Adm to retrieveadm4Code
- The Adm4Code of the Adm to retrieve NOTE : The
countryCode will be automaticaly converted in upperCaseIAdmDao.getAdm1(String, String)
,
IAdmDao.getAdm2(String, String, String)
,
IAdmDao.getAdm3(String, String, String, String)
,
IAdmDao.getAdm4(String, String, String, String, String)
,
IAdmDao.getAdmByCountryAndCodeAndLevel(String, String, int)
,
Adm.getProcessedLevelFromCodes(String, String, String, String)
public List<Adm> getDirties()
IGisDao
getDirties
in interface IGisDao<Adm>
getDirties
in class GenericGisDao<Adm>
public List<Adm> getAllbyLevel(int level)
getAllbyLevel
in interface IAdmDao
level
- The level of the Adms to retrieve. The Level is not
checked (not necessary beetween 1 and 4)public long countByLevel(int level)
countByLevel
in interface IAdmDao
level
- The level we want the Adm to count The Level is not
checked (not necessary beetween 1 and 4)public List<Adm> getAdmByCountryAndCodeAndLevel(String countryCode, String admCode, int level)
IAdmDao
getAdmByCountryAndCodeAndLevel
in interface IAdmDao
countryCode
- The countryCode that the Adm must belongs toadmCode
- The code of the Adm for the specified levellevel
- The level of the Adm : The Level is not checked (not
necessary beetween 1 and 4)public Adm getAdmOrFirstValidParentIfNotFound(String countryCode, String adm1Code, String adm2Code, String adm3Code, String adm4Code)
IAdmDao
IAdmDao.getAdm(String, String, String, String, String)
or the first
valid parent if no Adm is found with the specified codes.IAdmDao.suggestMostAccurateAdm(String, String, String, String, String, GisFeature)
getAdmOrFirstValidParentIfNotFound
in interface IAdmDao
countryCode
- The country code of the Adm to retrieveadm1Code
- The Adm1Code of the Adm to retrieveadm2Code
- The Adm2Code of the Adm to retrieveadm3Code
- The Adm3Code of the Adm to retrieveadm4Code
- The Adm4Code of the Adm to retrieveIAdmDao.getAdm(String, String, String, String, String)
or the
first valid parent if no Adm is found with the specified codesIAdmDao.getAdmByCountryAndCodeAndLevel(String, String, int)
,
Adm.getProcessedLevelFromCodes(String, String, String, String)
public Adm suggestMostAccurateAdm(String countryCode, String adm1Code, String adm2Code, String adm3Code, String adm4Code, GisFeature gisfeature)
IAdmDao
ImporterConfig.isTryToDetectAdmIfNotFound()
is true or when error
correction is needed. the algorithm will return an Adm according the
specified rules:
IAdmDao.getAdm(String, String, String, String, String)
) : retrun itIAdmDao.getAdmOrFirstValidParentIfNotFound(String, String, String, String, String)
:
return Adm with the highest not null level IAdmDao.getAdmOrFirstValidParentIfNotFound(String, String, String, String, String)
:
IAdmDao.getAdmOrFirstValidParentIfNotFound(String, String, String, String, String)
:
return Adm with the highest not null level : return the ParentsuggestMostAccurateAdm
in interface IAdmDao
countryCode
- The country code of the Adm to retrieveadm1Code
- The Adm1Code of the Adm to retrieveadm2Code
- The Adm2Code of the Adm to retrieveadm3Code
- The Adm3Code of the Adm to retrieveadm4Code
- The Adm4Code of the Adm to retrievegisfeature
- The gisFeature is not really used in the algorithm, but it
can be useful to have it for logs or for specific
algorithm implementation.(It is only used for logs)IAdmDao.getAdmOrFirstValidParentIfNotFound(String, String, String, String,
String)
public int deleteAllByLevel(int level)
deleteAllByLevel
in interface IAdmDao
level
- the level we want to delete Adm return the number of
deleted Admpublic List<Long> listFeatureIdByLevel(int level)
IAdmDao
listFeatureIdByLevel
in interface IAdmDao
level
- the levelCopyright © 2015. All rights reserved.