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,retrieval=CONSTRUCTOR))
@PropertyMapping(processor=@PropertyMappingAnnotationProcessorRef(type=org.hibernate.search.mapper.pojo.bridge.builtin.annotation.processor.impl.GeoPointBindingProcessor.class,retrieval=CONSTRUCTOR))
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
-
Nested Class Summary
Nested Classes -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe name of the index field holding spatial information.
-
Element Details
-
fieldName
String fieldNameThe 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 toProjectable.DEFAULT
.
- Default:
DEFAULT
-
sortable
Sortable sortable- Returns:
- Returns an instance of the
Sortable
enum, indicating whether sorts are enabled for this field. Defaults toSortable.DEFAULT
.
- Default:
DEFAULT
-
markerSet
String markerSet- Returns:
- The name of the marker set this spatial should look into
when looking for the
Latitude
andLongitude
markers.
- Default:
""
-