Annotation Type Spatial


  • @Retention(RUNTIME)
    @Target({METHOD,FIELD,TYPE})
    @Documented
    @Deprecated
    @Repeatable(Spatials.class)
    @TypeMapping(processor=@TypeMappingAnnotationProcessorRef(type=org.hibernate.search.annotations.impl.SpatialAnnotationProcessor.class,retrieval=CONSTRUCTOR))
    @PropertyMapping(processor=@PropertyMappingAnnotationProcessorRef(type=org.hibernate.search.annotations.impl.SpatialAnnotationProcessor.class,retrieval=CONSTRUCTOR))
    public @interface Spatial
    Deprecated.
    If the latitude/longitude of the element annotated with Spatial are mutable, annotate these properties annotated with Latitude/Longitude, and use GeoPointBinding instead of Spatial. If the latitude/longitude of the element annotated with Spatial are immutable, you can alternatively implement GeoPoint instead of Coordinates and simply use GenericField on properties of this type.
    Defines a spatial property. Spatial coordinates can be indexed as latitude / longitude fields and queried via range queries. This is known as the SpatialMode.RANGE approach. Otherwise, they can be indexed using a spatial hash index. This is known as the SpatialMode.HASH approach. The size of the grid can be adjusted with topSpatialHashLevel and bottomSpatialHashLevel. For more information on which model to use, read the Hibernate Search reference documentation. If your longitude and latitude information are hosted on free properties, Add @Spatial on the entity (class-level). The Latitude and Longitude annotations must mark the properties.
     @Entity
     @Spatial(name="home")
     public class User {
         @Latitude(of="home")
         public Double getHomeLatitude() { ... }
         @Longitude(of="home")
         public Double getHomeLongitude() { ... }
     }
     
    Alternatively, you can put the latitude / longitude information in a property of type Coordinates.
     @Entity
     public class User {
         @Spatial
         public Coordinates getHome() { ... }
     }
     
    Author:
    Nicolas Helleringer
    Experimental
    Spatial support is still considered experimental
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String name
      Deprecated.
      The name of the field prefix where spatial index information is stored in a Lucene document.
      Store store
      Deprecated.
       
    • Field Detail

      • COORDINATES_DEFAULT_FIELD

        static final String COORDINATES_DEFAULT_FIELD
        Deprecated.
        Prefix used to generate field names for a default Spatial annotation
    • Element Detail

      • name

        String name
        Deprecated.
        The name of the field prefix where spatial index information is stored in a Lucene document. If @Spatial is hosted on a property, defaults to the property name.
        Returns:
        the field name
        Default:
        ""
      • store

        Store store
        Deprecated.
        Returns:
        Returns an instance of the Store enum, indicating whether the value should be stored in the document. Defaults to Store.NO
        Default:
        org.hibernate.search.annotations.Store.NO