Java GAE ClassCastException Long不能转换为双精度

Java GAE ClassCastException Long不能转换为双精度,java,Java,尝试从数据存储实体获取数据时发生异常。 这是我的密码: PersistenceManager pmf = PMF.get().getPersistenceManager(); try { Query query = pmf.newQuery(DocHeader.class); @SuppressWarnings("unchecked") List<DocHeader> docHeaders = (List<DocHeader>) query.ex

尝试从数据存储实体获取数据时发生异常。 这是我的密码:

PersistenceManager pmf = PMF.get().getPersistenceManager();

try {
    Query query = pmf.newQuery(DocHeader.class);
    @SuppressWarnings("unchecked")
    List<DocHeader> docHeaders = (List<DocHeader>) query.execute();
例外

ClassCastException Long不能转换为双精度

表示您在数据存储中至少保存了一个
DocHeader
实体,其中一个属性是
Long
数字,但在Java实体中,您将其指定为
Double
,当您要查询它并将其转换回Java类时,尝试的转换
Long
->
Double
引发异常

您可以使用低级数据存储api读取所有
DocHeader
实体,并将
Long
属性更改为
Double
,该属性首先应该是
Double
,然后重新保存这些实体。或者,如果当前实体不重要(例如测试数据),只需删除它们即可


文档:

DocHeader
您自己的类吗?是的,这是我自己的类。我使用这个类存储数据。当获取数据时显示错误,您可以发布这个类的源代码(编辑问题)吗?嗯,以及最重要的事实?ClassCastException本身。。。它的堆栈跟踪?
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class DocHeader {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.SEQUENCE)
    private Long docHeaderId;

    @Persistent
    private Double previousPayment;

    @Persistent
    private Double currentBalance;

    @Persistent
    private Double totalAccountBalance;

    @Persistent
    private String accountRepresentative;

    @Persistent
    private Double minPayment;

}