package kundedb.models;
import com.avaje.ebean.Model;
import javax.persistence.*;
@Entity
@Table(name = "posisjoner")
public class Posisjon extends Model {
public static Finder<Long, Posisjon> find = new Finder<>("kundedb",Posisjon.class);
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "posnr")
public Long id;
public Double lat;
public Double lon;
public Integer moh;
public String posnavn ;
public static Posisjon findByName(String name) {
return Posisjon.find.where().eq("posnavn", name).findUnique();
}
@Override
public String toString() {
return "Posisjon{" +
"id=" + id +
", lat=" + lat +
", lon=" + lon +
", moh=" + moh +
", posnavn='" + posnavn + '\'' +
'}';
}
}