Thank Adrian, Not good for my situation but it is the resolution.
*RONG NGUYEN (Mr)* *OLBIUS FOUNDER**Email:* [email protected] | *Mobile:* (+84) 902 2468 45 *OLBIUS., JSC* *Tel:* (+84) 9 88 99 3333 *Address: *Room 2508, M3-M4 building, No 91, Nguyen Chi Thanh St., Ha Noi City, VietNam *Website:* http://olbius.com On Wed, Oct 22, 2014 at 5:20 PM, Adrian Crum < [email protected]> wrote: > mapCondition.put("quantity", BigDecimal.valueOf(123)); > > > Adrian Crum > Sandglass Software > www.sandglass-software.com > > > On 10/22/2014 11:07 AM, Rong Nguyen wrote: > >> Hi, >> >> I have tried to search with numeric type but i encounter >> java.lang.ClassCastException. >> >> *Scenario:* >> 1. Quantity field in InvoiceItem entity has numeric type. >> 2. Query command: >> mapCondition.put("quantity", "123"); >> delegator.find("InvoiceItem", EntityCondition.makeCondition( >> mapCondition), >> null, null, null, null); >> 3. I found flow of code after debugging: >> >> sqlP.setValue(handler, handler.getJavaClass().cast(fieldValue)); // row >> 783 >> >> public T cast(Object obj) { // from row 2997 >> if (obj != null && !isInstance(obj)) >> throw new ClassCastException(); // The code cause CCE >> return (T) obj; >> } >> >> Is there anyone encountered this issue? >> >> >> >> ----- >> Rong Nguyen >> >> Olbius JSC >> Deliver highest business value >> http://www.olbius.com/ >> -- >> View this message in context: http://ofbiz.135035.n4.nabble. >> com/How-to-find-numeric-type-tp4657235.html >> Sent from the OFBiz - Dev mailing list archive at Nabble.com. >> >>
