|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate3.support.HibernateDaoSupport
com.gisgraphy.domain.repository.GenericDao<T,Long>
com.gisgraphy.domain.repository.GenericGisDao<T>
T
- the type of the object the Gis Dao applypublic class GenericGisDao<T extends GisFeature>
Generic Dao for Gis Object (java-5 meaning) It suppose that the PK is of type
long because its goal is to be used with class gisfeatures and class that
extends GisFeature. if it is note the case. it is possible to create an other
inteface
it adds some method to the GenericDao in order to acess GIS objects
GenericDao
Field Summary | |
---|---|
static org.hibernate.type.Type |
GEOMETRY_TYPE
|
static int |
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 | |
---|---|
GenericGisDao(Class<T> persistentClass)
Constructor |
Method Summary | |
---|---|
void |
createGISTIndexForLocationColumn()
Create the database GIST index for the column 'location' for this entity |
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 |
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)
|
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)
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)
|
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)
|
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.IDao |
---|
count, exists, flushAndClear, get, getAll, getAllPaginate, getPersistenceClass, setFlushMode |
Field Detail |
---|
public static final org.hibernate.type.Type GEOMETRY_TYPE
public static final int MAX_FULLTEXT_RESULTS
Constructor Detail |
---|
public GenericGisDao(Class<T> persistentClass)
persistentClass
- The specified Class for the GenericGisDaoMethod Detail |
---|
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 distance
GisFeatureDistance
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 distance
GisFeatureDistance
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 paginate
getNearestAndDistanceFrom
in interface IGisDao<T extends GisFeature>
point
- The point from which we want to find GIS Objectdistance
- distance The radius in meters
GisFeatureDistance
public List<com.gisgraphy.domain.valueobject.GisFeatureDistance> getNearestAndDistanceFrom(com.vividsolutions.jts.geom.Point point, double distance, int firstResult, int maxResults, boolean includeDistanceField)
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 distance
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)
point
- The point from which we want to find GIS Objectdistance
- distance The radius in meterspointId
- 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 nearestfirstResult
- 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 retireved
GisFeatureDistance
public List<T> listByName(String name)
IGisDao
listByName
in interface IGisDao<T extends GisFeature>
name
- the name of the objects to retrieve
IGisDao.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 retrieve
public 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 save
public 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 retrieve
public 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
- wether we search in the alternatenames too
MAX_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 apply
MAX_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 retrieve
IDao.get(java.io.Serializable)
public void setEventManager(EventManager eventManager)
public void createGISTIndexForLocationColumn()
IGisDao
createGISTIndexForLocationColumn
in interface IGisDao<T extends GisFeature>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |