【发布时间】:2013-08-15 16:12:03
【问题描述】:
我有一个尝试部署到 Heroku 的 Play 2.0 应用程序。在成功编译并在 localhost 上运行后,Heroku 抱怨 type "double" 不存在。该应用程序本身与此处的 JavaTodoList 教程极为相似:
http://www.playframework.com/documentation/2.0/JavaTodoList
除了模型有 Double 字段,而不是 String 字段,像这样:
package models;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.Id;
import play.data.validation.Constraints.Required;
import play.db.ebean.Model;
@SuppressWarnings("serial")
@Entity
public class GeoPoint extends Model {
@Id
public Long id;
@Required
public Double latitude;
@Required
public Double longitude;
@SuppressWarnings({ "rawtypes", "unchecked" })
public static Finder<Long, GeoPoint> find = new Finder(Long.class, GeoPoint.class);
public static List<GeoPoint> all() {
return find.all();
}
public static void create(GeoPoint task) {
task.save();
}
public static void delete(Long id) {
find.ref(id).delete();
}
}
我相信这与 PostgreSQL 驱动程序生成 SQL 的类型为 double 而不是 double precision 的列有关。
【问题讨论】:
标签: postgresql heroku playframework-2.0