T
- public class GenericGisDao<T extends GisFeature> extends GenericDao<T,Long> implements IGisDao<T>
Modifier and Type | Field and Description |
---|---|
static org.hibernate.type.Type |
GEOMETRY_TYPE |
static int |
MAX_FULLTEXT_RESULTS |
persistentClass
Constructor and Description |
---|
GenericGisDao(Class<T> persistentClass)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
createGISTIndexForLocationColumn()
Create the database GIST index for the column 'location' for this entity if it doesn't already exists
|
void |
createGISTIndexForShapeColumn()
create the shape index for the entity if it doesn't already exists.
|
int |
deleteAll()
Delete all the object from the datastore
|
void |
deleteAll(List<T> list)
Delete all the specified object from the datastore
|
T |
getByFeatureId(Long featureId)
It is not the same as
IDao.get(java.io.Serializable) which
retrieve an object from his PK. |
List<T> |
getDirties()
Returns inconsistant object (in most case object With featureid < 0)
|
T |
getEager(Long id)
Same as IDao#get(java.io.Serializable) but load the AlternateNames and
The linked Adm
|
T |
getNearest(com.vividsolutions.jts.geom.Point location,
String countryCode,
boolean filterMunicipality,
int distance) |
List<com.gisgraphy.domain.valueobject.GisFeatureDistance> |
getNearestAndDistanceFrom(com.vividsolutions.jts.geom.Point point,
double distance)
same as
IGisDao.getNearestAndDistanceFromGisFeature(GisFeature, double, int, int, boolean) but
without paginate |
List<com.gisgraphy.domain.valueobject.GisFeatureDistance> |
getNearestAndDistanceFrom(com.vividsolutions.jts.geom.Point point,
double distance,
int firstResult,
int maxResults,
boolean includeDistanceField,
boolean isMunicipality) |
protected List<com.gisgraphy.domain.valueobject.GisFeatureDistance> |
getNearestAndDistanceFrom(com.vividsolutions.jts.geom.Point point,
Long pointId,
double distance,
int firstResult,
int maxResults,
boolean includeDistanceField,
Class<? extends GisFeature> requiredClass,
boolean isMunicipality)
base method for all findNearest*
|
List<com.gisgraphy.domain.valueobject.GisFeatureDistance> |
getNearestAndDistanceFromGisFeature(GisFeature gisFeature,
double distance,
boolean includeDistanceField) |
List<com.gisgraphy.domain.valueobject.GisFeatureDistance> |
getNearestAndDistanceFromGisFeature(GisFeature gisFeature,
double distance,
int firstResult,
int maxResults,
boolean includeDistanceField) |
String |
getShapeAsWKTByFeatureId(Long featureId) |
List<T> |
listByFeatureIds(List<Long> ids)
return all the Object with the specified featureIds (not ids :id is the
PK (aka datastore id), featureId is the domain value). return an
emptylist if the list of ids is null or empty).
|
List<T> |
listByName(String name)
retrieve the Objects with the specified name (not the ASCII one)
|
List<T> |
listFromText(String name,
boolean includeAlternateNames)
Do a full text search for the given name.
|
protected List<T> |
listFromText(String name,
boolean includeAlternateNames,
Class<T> clazz)
Do a full text search for the given name.
|
void |
remove(T gisFeature)
remove the object from the datastore
|
T |
save(T GisFeature)
Saves the passed object, and returns an attached entity.
|
void |
setEventManager(EventManager eventManager) |
count, exists, flushAndClear, get, 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
count, exists, flushAndClear, get, getAll, getAllPaginate, getPersistenceClass, setFlushMode
public static final org.hibernate.type.Type GEOMETRY_TYPE
public static final int MAX_FULLTEXT_RESULTS
public List<com.gisgraphy.domain.valueobject.GisFeatureDistance> getNearestAndDistanceFromGisFeature(GisFeature gisFeature, double distance, int firstResult, int maxResults, boolean includeDistanceField)
getNearestAndDistanceFromGisFeature
in interface IGisDao<T extends GisFeature>
gisFeature
- The GisFeature from which we want to find GIS Objectdistance
- distance The radius in metersfirstResult
- the firstResult index (for pagination), numbered from 1,
if < 1 : it will not be taken into accountmaxResults
- The Maximum number of results to retrieve (for
pagination), if <= 0 : it will not be taken into acountincludeDistanceField
- Field whether or not we should process calculate the distanceGisFeatureDistance
public List<com.gisgraphy.domain.valueobject.GisFeatureDistance> getNearestAndDistanceFromGisFeature(GisFeature gisFeature, double distance, boolean includeDistanceField)
getNearestAndDistanceFromGisFeature
in interface IGisDao<T extends GisFeature>
gisFeature
- The GisFeature from which we want to find GIS Objectdistance
- distance The radius in metersincludeDistanceField
- Field whether or not we should process calculate the distanceGisFeatureDistance
public List<com.gisgraphy.domain.valueobject.GisFeatureDistance> getNearestAndDistanceFrom(com.vividsolutions.jts.geom.Point point, double distance)
IGisDao
IGisDao.getNearestAndDistanceFromGisFeature(GisFeature, double, int, int, boolean)
but
without paginategetNearestAndDistanceFrom
in interface IGisDao<T extends GisFeature>
point
- The point from which we want to find GIS Objectdistance
- distance The radius in metersGisFeatureDistance
public List<com.gisgraphy.domain.valueobject.GisFeatureDistance> getNearestAndDistanceFrom(com.vividsolutions.jts.geom.Point point, double distance, int firstResult, int maxResults, boolean includeDistanceField, boolean isMunicipality)
getNearestAndDistanceFrom
in interface IGisDao<T extends GisFeature>
point
- The point from which we want to find GIS Objectdistance
- distance The radius in metersfirstResult
- the firstResult index (for pagination), numbered from 1,
if < 1 : it will not be taken into accountmaxResults
- The Maximum number of results to retrieve (for
pagination), if <= 0 : it will not be taken into acountincludeDistanceField
- Field whether or not we should process calculate the distanceisMunicipality
- whether we should filter on city that are flag as 'municipality'.
act as a filter, if false it doesn't filters( false doesn't mean that we return non municipality)GisFeatureDistance
protected List<com.gisgraphy.domain.valueobject.GisFeatureDistance> getNearestAndDistanceFrom(com.vividsolutions.jts.geom.Point point, Long pointId, double distance, int firstResult, int maxResults, boolean includeDistanceField, Class<? extends GisFeature> requiredClass, boolean isMunicipality)
point
- The point from which we want to find GIS ObjectpointId
- the id of the point that we don't want to be include, it
is used to not include the gisFeature from which we want
to find the nearestdistance
- distance The radius in metersfirstResult
- the firstResult index (for pagination), numbered from 1,
if < 1 : it will not be taken into accountmaxResults
- The Maximum number of results to retrieve (for
pagination), if <= 0 : it will not be taken into acountrequiredClass
- the class of the object to be retirevedisMunicipality
- whether we should filter on city that are flag as 'municipality'.
act as a filter, if false it doesn't filters( false doesn't mean that we return non municipality)GisFeatureDistance
public List<T> listByName(String name)
IGisDao
listByName
in interface IGisDao<T extends GisFeature>
name
- the name of the objects to retrieveIGisDao.listFromText(String, boolean)
public T getByFeatureId(Long featureId)
IGisDao
IDao.get(java.io.Serializable)
which
retrieve an object from his PK.getByFeatureId
in interface IGisDao<T extends GisFeature>
featureId
- the featureid of the GIS object to retrievepublic List<T> getDirties()
IGisDao
getDirties
in interface IGisDao<T extends GisFeature>
public T save(T GisFeature)
IDao
save
in interface IDao<T extends GisFeature,Long>
save
in class GenericDao<T extends GisFeature,Long>
GisFeature
- The object to savepublic void remove(T gisFeature)
IDao
remove
in interface IDao<T extends GisFeature,Long>
remove
in class GenericDao<T extends GisFeature,Long>
gisFeature
- The object to removepublic List<T> listByFeatureIds(List<Long> ids)
IGisDao
listByFeatureIds
in interface IGisDao<T extends GisFeature>
ids
- the list of the ids of the object to retrievepublic List<T> listFromText(String name, boolean includeAlternateNames)
IGisDao
listFromText
in interface IGisDao<T extends GisFeature>
name
- the name or zipcode of the GisFeature to searchincludeAlternateNames
- whether we search in the alternatenames tooMAX_FULLTEXT_RESULTS
;IGisFeatureDao.listAllFeaturesFromText(String, boolean)
protected List<T> listFromText(String name, boolean includeAlternateNames, Class<T> clazz)
name
- The name to search forincludeAlternateNames
- Wether we search in the alternatenames tooclazz
- specify the features we want to search for, if null : no
restriction is applyMAX_FULLTEXT_RESULTS
;IGisFeatureDao.listAllFeaturesFromText(String, boolean)
public void deleteAll(List<T> list)
IDao
deleteAll
in interface IDao<T extends GisFeature,Long>
deleteAll
in class GenericDao<T extends GisFeature,Long>
list
- the list of element to deletepublic int deleteAll()
IDao
deleteAll
in interface IDao<T extends GisFeature,Long>
deleteAll
in class GenericDao<T extends GisFeature,Long>
public T getEager(Long id)
IGisDao
getEager
in interface IGisDao<T extends GisFeature>
id
- the id of the features to retrieveIDao.get(java.io.Serializable)
public void setEventManager(EventManager eventManager)
public void createGISTIndexForLocationColumn()
IGisDao
createGISTIndexForLocationColumn
in interface IGisDao<T extends GisFeature>
public T getNearest(com.vividsolutions.jts.geom.Point location, String countryCode, boolean filterMunicipality, int distance)
getNearest
in interface IGisDao<T extends GisFeature>
location
- The point from which we want to find GIS ObjectcountryCode
- restrict the search to a given country code (useful for feature near a frontierfilterMunicipality
- if we should filter municipality or notdistance
- te distance in meterpublic void createGISTIndexForShapeColumn()
IGisDao
createGISTIndexForShapeColumn
in interface IGisDao<T extends GisFeature>
public String getShapeAsWKTByFeatureId(Long featureId)
getShapeAsWKTByFeatureId
in interface IGisDao<T extends GisFeature>
Copyright © 2015. All rights reserved.