Discussions
Categories
- 197.1K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.7K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 555 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.3K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 466 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
BigDecimal type with DefaultBigDecimalFormatter not working in table QBE

Hi,
I have a problem with table filter with search fields that are BigDecimal and are using DefaultBigDecimalFormatter.
The problem occurs when i set locale to non-english, that is to Croatian. In my language decimal separator is comma(",").
I have printed the bind values in bindParametersForCollection method in ViewObject and discovered that for input value 7,44 in QBE, i am getting value 744 as the final value.
After searching a little bit more i found out that it is because framework is creating a new VariableImpl object that gets the value form associated viewCriteriaItem.
Value that viewCriteriaItem return is already formatted and the value is for example 7.44.
Now the framework try's to format this value again with the same locale (Croatian) and than the number formatter returns the number 744.
And that is the final value that gets into the query.
Is this a known bug?
Any solutions to this?
JDeveloper: 12.2.1.2.0.0
Robert
Answers
-
Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,552 Red Diamond
This looks like a bug. However, the only way to know is to file a SR with support.oracle.com (payable support contract needed).
Have you tried another formatter?
Or created your own as a workaround?
Timo
-
Hi Timo,
thank you for your reply.
I didn't try other converters but i thought that converter may be the problem. Now that you are asking the same question i will try it tomorrow.
My workaround is to override method getCriteriaAdapter() in ViewObjectImpl for which is stated next:
/** * Return a custom CriteriaAdapter implementation to generate where clause * for ViewCriteria. The default implementation here returns null, and leave * it to the ViewCriteriaManager implementation class to determine which * CriteriaAdapter class to use. * Subclasses can override this method to provide a custom CriteriaAdapter * implementation. * * @return Custom CriteriaAdapter implementation if desired, or null. */
So i made a new class that extends OracleSQLBuilderImpl class.
I have overridden the method createTemporaryBindVar(ViewCriteria,ViewCriteriaItem,index).
There i checked if the ViewCriteriaItem .getJavaType() equals BigDecimal.class and if so i just kept the value without calling the standard formatting.
Robert
-
So i have tried Number and Currency converter and have the same issue
It is a bug in framework, nothing related to converters.
Robert
-
After applying this implementation i have another problem
We are setting NLS parameters to the session because of the sort issue, so now if the nls parameters are set to CROATIAN/CROATIA the db now expects number in with comma (",") as a decimal separator.
Since the framework doesn't convert it to croatian locale i m getting invalid number exception. ( value sent to db has dot as a decimal separator)
If i replace dot with a comma in my custom implementation than i m getting number parse exception because it is trying to instantiate a BigDecimal object with comma as a decimal separator.
Any thoughts on this?
Robert