Hi,
JIRA : 5.2.11
My created custom field plugin raise me below error while creating an issue (create issue screen contain that custom field):
Error creating issue: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:CustomFieldValue][id,14375][issue,13194][numbervalue,1.554][parentkey,input1][customfield,11274] (SQL Exception while executing the following:INSERT INTO public.customfieldvalue (ID, ISSUE, CUSTOMFIELD, PARENTKEY, STRINGVALUE, NUMBERVALUE, TEXTVALUE, DATEVALUE, VALUETYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: column "numbervalue" is of type double precision but expression is of type character varying Hint: You will need to rewrite or cast the expression. Position: 160))
My customf field plugin is uses - "PersistenceFieldType CASCADE_VALUE_TYPE = PersistenceFieldType.TYPE_DECIMAL" as all input will be Numeric only.
what should i handle in this field "getStringFromSingularObject" as it seems exception raise from this method ?
at present below is the stuff for "getStringFromSingularObject"
public String getStringFromSingularObject(Object singularObject) { if((singularObject instanceof Integer ) == true) { return Integer.toString((Integer)singularObject); } if((singularObject instanceof Double ) == true) { return Double.toString((Double)singularObject); } return singularObject.toString(); }
[I need input as a - NUMBER only then it would work correctly. But, user has entered numerics though it raise me an error as shown above.]
thanks
Community moderators have prevented the ability to post new answers.
Your data is not the right type. It looks like your code is trying to handle it as a string, but you are trying to put it in as a number.
You say you're using cascade_value_type of decimal, but the error you're getting is you trying to store a numeric value.
Hi Nic
Please see updated question.
Basically, my field should have input as Numeric data only.
so, i have taken "cascade_value_type" is type of decimal.
Now, its working fine at locally but facing that mentioned error in live JIRA.
(it seems to me, input data is unable to cast in "getStringFromSingularObject" method and throw such exception). when i faced this error then data are numeric only and it should work as correct input.
how it could be resolve ?
Thank You
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.