java - GAE ClassCastException Long cannot be cast to double -
java - GAE ClassCastException Long cannot be cast to double -
getting exception when trying fetch info datastore entity. here code:
persistencemanager pmf = pmf.get().getpersistencemanager(); seek { query query = pmf.newquery(docheader.class); @suppresswarnings("unchecked") list<docheader> docheaders = (list<docheader>) query.execute();
anyone can help in issue.
here object
@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; }
the exception
classcastexception long cannot cast double
means have @ to the lowest degree 1 docheader
entity saved in datastore saved 1 of property beingness long
number in java entity specified double
, when want query , convert java class, attempted conversion long
-> double
throws exception.
what may read docheader
entitites using low-level datastore api, , alter long
properties double
supposed double
in first place, resave entities. or if current entities not of import (e.g. test data), delete them.
documentation: java low-level datastore api
java
Comments
Post a Comment