com.gisgraphy.domain.repository

## Interface IGisDao<T>

- All Superinterfaces:
    IDao<T,Long>
  All Known Subinterfaces:
    IAdmDao, ICityDao, ICountryDao, IGisFeatureDao
  All Known Implementing Classes:
    AdmBuildingDao, AdmDao, AirportDao, AmbulanceDao, AmuseParkDao, AqueducDao, ATMDao, BankDao, BarDao, BayDao, BeachDao, BenchDao, BridgeDao, BuildingDao, BusStationDao, CampDao, CampingDao, CanyonDao, CasinoDao, CastleDao, CaveDao, CemeteryDao, CinemaDao, CirqueDao, CityDao, CityHallDao, CitySubdivisionDao, CliffDao, CoastDao, ContinentDao, CountryDao, CourtHouseDao, CraftDao, CustomsPostDao, DamDao, DentistDao, DesertDao, DoctorDao, EmergencyPhoneDao, FactoryDao, FallsDao, FarmDao, FerryTerminalDao, FieldDao, FireStationDao, FishingAreaDao, FjordDao, ForestDao, FountainDao, FuelDao, GardenDao, GenericGisDao, GisFeatureDao, GolfDao, GorgeDao, GrassLandDao, GulfDao, HillDao, HospitalDao, HotelDao, HouseDao, IceDao, IslandDao, LakeDao, LibraryDao, LightHouseDao, MallDao, MarshDao, MetroStationDao, MilitaryDao, MillDao, MineDao, MoleDao, MonumentDao, MoundDao, MountainDao, MuseumDao, NightClubDao, OasisDao, ObservatoryPointDao, OceanDao, OperaHouseDao, ParkDao, ParkingDao, PharmacyDao, PicnicDao, PlantationDao, PolicePostDao, PoliticalEntityDao, PondDao, PortDao, PostOfficeDao, PrisonDao, PyramidDao, QuayDao, RailDao, RailRoadStationDao, RanchDao, RavinDao, ReefDao, ReligiousDao, RentalDao, ReserveDao, RestAreaDao, RestaurantDao, RoadDao, SchoolDao, SeaDao, ShopDao, SportDao, SpringDao, StadiumDao, StraitDao, StreamDao, StreetDao, SwimmingPoolDao, TaxiDao, TelephoneDao, TheaterDao, ToiletDao, TourismDao, TourismInfoDao, TowerDao, TreeDao, TunnelDao, UnderSeaDao, VendingMachineDao, VeterinaryDao, VineyardDao, VolcanoDao, WaterBodyDao, ZooDao

      public interface IGisDao<T>
      extends IDao<T,Long>

  Interface for a 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
  : public interface IGisDao extends IDao it adds some method to the IDao in order to acess GIS objects
  Author:
    David Masclet
  See Also:
    `GenericGisDao`, `IDao`

- - ### Method Summary

    Methods
    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.
    `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 `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)`
    `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.

    - ### Methods inherited from interface com.gisgraphy.domain.repository.IDao

      `count, deleteAll, deleteAll, exists, flushAndClear, get, getAll, getAllPaginate, getPersistenceClass, remove, save, setFlushMode`

- - ### Method Detail

    - #### getByFeatureId

          T getByFeatureId(Long featureId)

      It is not the same as `IDao.get(java.io.Serializable)` which retrieve an object from his PK.
      Parameters:
        `featureId` - the featureid of the GIS object to retrieve
      Returns:
        the Gis Object with the specified GisFeature id.
      Throws:
        `IllegalArgumentException` - if the FeatureId is null

    - #### getDirties

          List<T> getDirties()

      Returns inconsistant object (in most case object With featureid < 0)
      Returns:
        List of populated objects (never return null, but an empty list)

    - #### getEager

          T getEager(Long id)

      Same as IDao#get(java.io.Serializable) but load the AlternateNames and The linked Adm
      Parameters:
        `id` - the id of the features to retrieve
      Returns:
        The Feature with the alternateName and the Adm loaded
      See Also:
        `IDao.get(java.io.Serializable)`

    - #### getNearestAndDistanceFromGisFeature

          List<com.gisgraphy.domain.valueobject.GisFeatureDistance> getNearestAndDistanceFromGisFeature(GisFeature gisFeature,
                                                                                                      double distance,
                                                                                                      boolean includeDistanceField)

      Parameters:
        `gisFeature` - The GisFeature from which we want to find GIS Object
        `distance` - distance The radius in meters
        `includeDistanceField` - Field whether or not we should process calculate the distance
      Returns:
        A List of GisFeatureDistance with the nearest elements or an emptylist (never return null), ordered by distance. note the specified gisFeature will not be included into results the results will be of the type of the currentDao
      See Also:
        `GisFeatureDistance`

    - #### getNearestAndDistanceFromGisFeature

          List<com.gisgraphy.domain.valueobject.GisFeatureDistance> getNearestAndDistanceFromGisFeature(GisFeature gisFeature,
                                                                                                      double distance,
                                                                                                      int firstResult,
                                                                                                      int maxResults,
                                                                                                      boolean includeDistanceField)

      Parameters:
        `gisFeature` - The GisFeature from which we want to find GIS Object
        `distance` - distance The radius in meters
        `firstResult` - the firstResult index (for pagination), numbered from 1, if < 1 : it will not be taken into account
        `maxResults` - The Maximum number of results to retrieve (for pagination), if <= 0 : it will not be taken into acount
        `includeDistanceField` - Field whether or not we should process calculate the distance
      Returns:
        A List of GisFeatureDistance with the nearest elements or an emptylist (never return null), ordered by distance. note the specified gisFeature will not be included into results the results will be of the type of the currentDao
        tips : to search the nearest place use firstresult=1 and maxResults=1
      See Also:
        `GisFeatureDistance`

    - #### getNearestAndDistanceFrom

          List<com.gisgraphy.domain.valueobject.GisFeatureDistance> getNearestAndDistanceFrom(com.vividsolutions.jts.geom.Point point,
                                                                                            double distance)

      same as `getNearestAndDistanceFromGisFeature(GisFeature, double, int, int, boolean)` but without paginate
      Parameters:
        `point` - The point from which we want to find GIS Object
        `distance` - distance The radius in meters
      Returns:
        A List of GisFeatureDistance with the nearest elements or an emptylist (never return null), ordered by distance. note the specified gisFeature will not be included into results the results will be of the type of the currentDao
      See Also:
        `GisFeatureDistance`

    - #### getNearestAndDistanceFrom

          List<com.gisgraphy.domain.valueobject.GisFeatureDistance> getNearestAndDistanceFrom(com.vividsolutions.jts.geom.Point point,
                                                                                            double distance,
                                                                                            int firstResult,
                                                                                            int maxResults,
                                                                                            boolean includeDistanceField,
                                                                                            boolean isMunicipality)

      Parameters:
        `point` - The point from which we want to find GIS Object
        `distance` - distance The radius in meters
        `firstResult` - the firstResult index (for pagination), numbered from 1, if < 1 : it will not be taken into account
        `maxResults` - The Maximum number of results to retrieve (for pagination), if <= 0 : it will not be taken into acount
        `includeDistanceField` - Field whether or not we should process calculate the distance
        `isMunicipality` - 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)
      Returns:
        A List of GisFeatureDistance with the nearest elements or an emptylist (never return null), ordered by distance. note the specified gisFeature will not be included into results the results will be of the type of the currentDao
        tips: to search the nearest place use firstresult=1 and maxResults=1
      See Also:
        `GisFeatureDistance`

    - #### listByName

          List<T> listByName(String name)

      retrieve the Objects with the specified name (not the ASCII one)
      Parameters:
        `name` - the name of the objects to retrieve
      Returns:
        List of populated objects list (never return null, but an empty list)
      See Also:
        `listFromText(String, boolean)`

    - #### listByFeatureIds

          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). The features will be of the type of the Dao.
      Parameters:
        `ids` - the list of the ids of the object to retrieve
      Returns:
        List of populated objects list (never return null, but an empty list)

    - #### listFromText

          List<T> listFromText(String name,
                             boolean includeAlternateNames)

      Do a full text search for the given name. The search will be case, iso-latin, comma-separated insensitive
      search for 'saint-André', 'saint-Andre', 'SaInT-andré', 'st-andré', etc will return the same results Polymorphism is not supported, e.g : if you use gisfeatureDao the results will only be of that type and no feature of type City that extends gisFeature...etc will be returned.
      Parameters:
        `name` - the name or zipcode of the GisFeature to search
        `includeAlternateNames` - whether we search in the alternatenames too
      Returns:
        a list of gisFeatures of type of the class for the given text. the max list size is `GenericGisDao.MAX_FULLTEXT_RESULTS`;
      See Also:
        `IGisFeatureDao.listAllFeaturesFromText(String, boolean)`

    - #### createGISTIndexForLocationColumn

          void createGISTIndexForLocationColumn()

      Create the database GIST index for the column 'location' for this entity if it doesn't already exists

    - #### getNearest

          T getNearest(com.vividsolutions.jts.geom.Point location,
                     String countryCode,
                     boolean filterMunicipality,
                     int distance)

      Parameters:
        `location` - The point from which we want to find GIS Object
        `countryCode` - restrict the search to a given country code (useful for feature near a frontier
        `filterMunicipality` - if we should filter municipality or not
        `distance` - te distance in meter
      Returns:
        the nearest city differ from getnearestAndDistance because doesn't return distance field and with zip and alternateNames are populated

    - #### createGISTIndexForShapeColumn

          void createGISTIndexForShapeColumn()

      create the shape index for the entity if it doesn't already exists.

    - #### getShapeAsWKTByFeatureId

          String getShapeAsWKTByFeatureId(Long featureId)

      Parameters:
        `featureId` -
      Returns:
        the shape as wkt or null;

Copyright © 2015. All rights reserved.