Annotation Type GeoPointBinding


  • @Retention(RUNTIME)
    @Target({METHOD,FIELD,TYPE})
    @Documented
    @Repeatable(List.class)
    @TypeMapping(processor=@TypeMappingAnnotationProcessorRef(type=org.hibernate.search.mapper.pojo.bridge.builtin.annotation.processor.impl.GeoPointBindingProcessor.class))
    @PropertyMapping(processor=@PropertyMappingAnnotationProcessorRef(type=org.hibernate.search.mapper.pojo.bridge.builtin.annotation.processor.impl.GeoPointBindingProcessor.class))
    public @interface GeoPointBinding
    Defines a GeoPoint binding from a type or a property to a GeoPoint field representing a point on earth.

    If the longitude and latitude information is hosted on two different properties, @GeoPointBinding must be used on the entity (class level). The Latitude and Longitude annotations must mark the properties.

    
     @GeoPointBinding(name="home")
     public class User {
         @Latitude
         public Double getHomeLatitude() { ... }
         @Longitude
         public Double getHomeLongitude() { ... }
     }
     

    Alternatively, @GeoPointBinding can be used on a type that implements GeoPoint:

    
     @GeoPointBinding(name="location")
     public class Home implements GeoPoint {
         @Override
         public Double getLatitude() { ... }
         @Override
         public Double getLongitude() { ... }
     }
     

    ... or on a property of type GeoPoint:

    
     public class User {
         @GeoPointBinding
         public GeoPoint getHome() { ... }
     }
     
    Author:
    Nicolas Helleringer
    • Element Detail

      • fieldName

        String fieldName
        The name of the index field holding spatial information. If @GeoPoint is hosted on a property, defaults to the property name. If @GeoPoint is hosted on a class, the name must be provided.
        Returns:
        the field name
        Default:
        ""
      • projectable

        Projectable projectable
        Returns:
        Returns an instance of the Projectable enum, indicating whether projections are enabled for this field. Defaults to Projectable.DEFAULT.
        Default:
        org.hibernate.search.engine.backend.types.Projectable.DEFAULT
      • sortable

        Sortable sortable
        Returns:
        Returns an instance of the Sortable enum, indicating whether sorts are enabled for this field. Defaults to Sortable.DEFAULT.
        Default:
        org.hibernate.search.engine.backend.types.Sortable.DEFAULT
      • markerSet

        String markerSet
        Returns:
        The name of the marker set this spatial should look into when looking for the Latitude and Longitude markers.
        Default:
        ""