spring - java.math.BigDecimal cannot be cast to [Ljava.lang.Object; -


list querylist = executereadallsqlquery(querystring);     (iterator = querylist.iterator(); i.hasnext();) {         object values[] = (object[]) i.next();         fdetails pdetails = transform(values);         fdlist.add(pdetails);         values = null;     } 

error getting @ line 3 : java.math.bigdecimal cannot cast [ljava.lang.object;

my transform function :

private fdetails transform(object[] values) {     fdetails details = new fdetails();     details.setpb((bigdecimal)values[0]);     details.setpm((bigdecimal)values[1]);     details.setel((bigdecimal)values[1]);     details.setul((bigdecimal)values[1]);     return balancedetails; } 

please me resolve these issue.

how code:

@suppresswarnings("rawtypes") list<bigdecimal> querylist = executereadallsqlquery(querystring);  fdetails details = new fdetails(); int = 0; details.setpb(querylist.get(i ++)); details.setpm(querylist.get(i ++)); ...  fdlist.add(pdetails); 

note: calling fdlist.add() inside of loop wrong. loop gets 1 value list want 5 values list, create one instance of fdetails 5 values , add single instance fdlist once


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -