Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PostgreSQL不';不喜欢双重类型的列_Postgresql_Heroku_Playframework 2.0 - Fatal编程技术网

PostgreSQL不';不喜欢双重类型的列

PostgreSQL不';不喜欢双重类型的列,postgresql,heroku,playframework-2.0,Postgresql,Heroku,Playframework 2.0,我有一个Play 2.0应用程序,我正试图部署到Heroku。Heroku在本地主机上成功编译并运行后,抱怨类型“double”不存在。应用程序本身与此处的JavaTodoList教程非常相似: 除了模型有双字段,而不是字符串字段,如下所示: package models; import java.util.List; import javax.persistence.Entity; import javax.persistence.Id; import play.data.valida

我有一个Play 2.0应用程序,我正试图部署到Heroku。Heroku在本地主机上成功编译并运行后,抱怨类型“double”不存在。应用程序本身与此处的JavaTodoList教程非常相似:

除了模型有双字段,而不是字符串字段,如下所示:

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();
    }

}
封装模型;
导入java.util.List;
导入javax.persistence.Entity;
导入javax.persistence.Id;
导入play.data.validation.Constraints.Required;
导入play.db.ebean.Model;
@抑制警告(“串行”)
@实体
公共类地点模型{
@身份证
公共长id;
@必需的
公共双纬度;
@必需的
公共双经度;
@SuppressWarnings({“rawtypes”,“unchecked”})
公共静态查找器find=新查找器(Long.class、GeoPoint.class);
公共静态列表所有(){
返回find.all();
}
公共静态空心创建(地质点任务){
task.save();
}
公共静态无效删除(长id){
find.ref(id.delete();
}
}

我相信这与PostgreSQL驱动程序生成SQL有关,SQL的列类型为double,而不是double precision

不确定ORM是什么,但我们正在heroku上运行ebean

这就是我们精确处理数字的方法

@Entity
@Table(name = "e_company_billing_contract_item")
   public class CompanyBillingContractItem extends GenericDBO{
   @JsonIgnore
   @ManyToOne
   private CompanyBillingContract contract;
   private String name;
   private int nbrIncluded;
   private int maxLimit;
   @Column(columnDefinition = "NUMERIC")
   private BigDecimal price;

很抱歉回复太晚,但这篇专栏正是我需要的。谢谢