/* * Hibernate Search, full-text search for your domain model * * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ package org.hibernate.search.test.spatial; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import org.hibernate.search.annotations.Indexed; import org.hibernate.search.annotations.Latitude; import org.hibernate.search.annotations.Longitude; import org.hibernate.search.annotations.Spatial; import org.hibernate.search.annotations.SpatialMode; @Spatial(name = "home", spatialMode = SpatialMode.HASH) @Entity @Indexed @Table(name = "people")// User is a reserved name in most databases public class User { @Id Integer id; @Latitude(of = "home") Double homeLatitude; @Longitude(of = "home") Double homeLongitude; public User(Integer id, Double homeLatitude, Double homeLongitude) { this.id = id; this.homeLatitude = homeLatitude; this.homeLongitude = homeLongitude; } public User() { } public Double getHomeLatitude() { return homeLatitude; } public void setHomeLatitude(Double homeLatitude) { this.homeLatitude = homeLatitude; } public Double getHomeLongitude() { return homeLongitude; } public void setHomeLongitude(Double homeLongitude) { this.homeLongitude = homeLongitude; } public Integer getId() { return id; } }