@PropertyBridgeMapping(builder=@PropertyBridgeAnnotationBuilderReference(type=org.hibernate.search.mapper.pojo.bridge.builtin.spatial.impl.GeoPointBridge.Builder.class)) @TypeBridgeMapping(builder=@TypeBridgeAnnotationBuilderReference(type=org.hibernate.search.mapper.pojo.bridge.builtin.spatial.impl.GeoPointBridge.Builder.class)) @Retention(value=RUNTIME) @Target(value={METHOD,FIELD,TYPE}) @Documented @Repeatable(value=GeoPointBridge.List.class) public @interface GeoPointBridge
@GeoPointBridge
on the entity (class-level). The Latitude
and Longitude
annotations must mark the properties.
@GeoPointBridge(name="home")
public class User {
@Latitude
public Double getHomeLatitude() { ... }
@Longitude
public Double getHomeLongitude() { ... }
}
Alternatively, you can put the latitude / longitude information in a property of
type GeoPoint
.
public class User {
@GeoPointBridge
public GeoPoint getHome() { ... }
}
... or make the entity itself implement GeoPoint
:
@GeoPointBridge(name="location")
public class Home implements GeoPoint {
@Override
public Double getLatitude() { ... }
@Override
public Double getLongitude() { ... }
}
Modifier and Type | Fields and Description |
---|---|
static int |
DEFAULT_BOTTOM_SPATIAL_HASH_LEVEL |
static int |
DEFAULT_TOP_SPATIAL_HASH_LEVEL |
Modifier and Type | Optional Element and Description |
---|---|
String |
fieldName
The name of the index field holding spatial information.
|
String |
markerSet |
Projectable |
projectable |
public abstract String fieldName
@GeoPoint
is hosted on a property, defaults to the property name.
If @GeoPoint
is hosted on a class, the name must be provided.public abstract Projectable projectable
Projectable
enum, indicating whether projections are enabled for this
field. Defaults to Projectable.DEFAULT
.Copyright © 2006-2018 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.