|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IAdmDao
Interface for Adm
data access
Method Summary | |
---|---|
long |
countByLevel(int level)
|
int |
deleteAllByLevel(int level)
|
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 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> |
getUnused()
|
List<Long> |
listFeatureIdByLevel(int level)
List all the featureId of the Adms of a specified level |
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
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
getAdmOrFirstValidParentIfNotFound(String, String, String, String, String) :
return Adm with the highest not null level
If a parent Adm is found (see
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
getAdmOrFirstValidParentIfNotFound(String, String, String, String, String) :
return Adm with the highest not null level : return the Parent
If no parent is found : return null
|
Methods inherited from interface com.gisgraphy.domain.repository.IGisDao |
---|
createGISTIndexForLocationColumn, getByFeatureId, getDirties, getEager, getNearestAndDistanceFrom, getNearestAndDistanceFrom, getNearestAndDistanceFromGisFeature, getNearestAndDistanceFromGisFeature, listByFeatureIds, listByName, listFromText |
Methods inherited from interface com.gisgraphy.domain.repository.IDao |
---|
count, deleteAll, deleteAll, exists, flushAndClear, get, getAll, getAllPaginate, getPersistenceClass, remove, save, setFlushMode |
Method Detail |
---|
List<Adm> getAllbyLevel(int level)
level
- The level of the Adms to retrieve. The Level is not
checked (not necessary beetween 1 and 4)
Adm getAdm1(String countryCode, String adm1Code)
countryCode
- The country code of the Adm to retrieveadm1Code
- The Adm1Code of the Adm to retrieve
IllegalArgumentException
- if any of the parameters are nullgetAdm(String, String, String, String, String)
,
getAdmByCountryAndCodeAndLevel(String, String, int)
Adm getAdm2(String countryCode, String adm1Code, String adm2Code)
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 upperCase
IllegalArgumentException
- if any of the parameters are nullgetAdm(String, String, String, String, String)
,
getAdmByCountryAndCodeAndLevel(String, String, int)
Adm getAdm3(String countryCode, String adm1Code, String adm2Code, String adm3Code)
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 upperCase
IllegalArgumentException
- if any of the parameters are nullgetAdm(String, String, String, String, String)
,
getAdmByCountryAndCodeAndLevel(String, String, int)
Adm getAdm4(String countryCode, String adm1Code, String adm2Code, String adm3Code, String adm4Code)
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 upperCase
IllegalArgumentException
- if any of the parameters are nullgetAdm(String, String, String, String, String)
Adm getAdm(String countryCode, String adm1Code, String adm2Code, String adm3Code, String adm4Code)
getAdm1(String, String)
,
getAdm2(String, String, String)
,
getAdm3(String, String, String, String)
, and
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.
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 upperCase
IllegalArgumentException
- if the countryCode is nullgetAdm1(String, String)
,
getAdm2(String, String, String)
,
getAdm3(String, String, String, String)
,
getAdm4(String, String, String, String, String)
,
getAdmByCountryAndCodeAndLevel(String, String, int)
,
Adm.getProcessedLevelFromCodes(String, String, String, String)
List<Adm> getAdmByCountryAndCodeAndLevel(String countryCode, String admCode, int level)
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)
IllegalArgumentException
- if countryCode or AdmCode is nullAdm getAdmOrFirstValidParentIfNotFound(String countryCode, String adm1Code, String adm2Code, String adm3Code, String adm4Code)
getAdm(String, String, String, String, String)
or the first
valid parent if no Adm is found with the specified codes.suggestMostAccurateAdm(String, String, String, String, String, GisFeature)
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
getAdm(String, String, String, String, String)
or the
first valid parent if no Adm is found with the specified codes
IllegalArgumentException
- if the countryCode is nullgetAdmByCountryAndCodeAndLevel(String, String, int)
,
Adm.getProcessedLevelFromCodes(String, String, String, String)
Adm suggestMostAccurateAdm(String countryCode, String adm1Code, String adm2Code, String adm3Code, String adm4Code, GisFeature gisFeature)
ImporterConfig.isTryToDetectAdmIfNotFound()
is true or when error
correction is needed. the algorithm will return an Adm according the
specified rules:
getAdm(String, String, String, String, String)
) : retrun itgetAdmOrFirstValidParentIfNotFound(String, String, String, String, String)
:
return Adm with the highest not null level getAdmOrFirstValidParentIfNotFound(String, String, String, String, String)
:
getAdmOrFirstValidParentIfNotFound(String, String, String, String, String)
:
return Adm with the highest not null level : return the Parent
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)
IllegalArgumentException
- if the countryCode is nullgetAdmOrFirstValidParentIfNotFound(String, String, String, String,
String)
long countByLevel(int level)
level
- The level we want the Adm to count The Level is not
checked (not necessary beetween 1 and 4)
List<Adm> getUnused()
int deleteAllByLevel(int level)
level
- the level we want to delete Adm return the number of
deleted AdmList<Long> listFeatureIdByLevel(int level)
level
- the level
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |