Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0023538 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] A. Platform | major | always | 2013-04-12 10:30 | 2013-04-30 21:05 | |||
Reporter | mirurita | View Status | public | |||||
Assigned To | shankarb | |||||||
Priority | high | Resolution | no change required | Fixed in Version | ||||
Status | closed | Fix in branch | pi | Fixed in SCM revision | 5e5dd4a8b5c0 | |||
Projection | none | ETA | none | Target Version | ||||
OS | Linux 32 bit | Database | PostgreSQL | Java version | 1.6.0_18 | |||
OS Version | Community Appliance | Database version | 8.3.9 | Ant version | 1.7.1 | |||
Product Version | pi | SCM revision | ||||||
Merge Request Status | ||||||||
Review Assigned To | alostale | |||||||
OBNetwork customer | No | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0023538: Tab whereclause not resolving properly comparations of YesNo (boolean) reference columns. | |||||||
Description | 1) As system admin mark FIN_Payment_Proposal.Isreceipt column as stored in session. 2) As system admin go to "Payment Proposal Pick and Edit Lines" window 2.1) Edit the "Pick and Edit Lines" tab whereclause replace e.salesTransaction = false for e.salesTransaction = @FIN_Payment_Proposal.receipt@ 3) compile 4) Go to Payment Proposal window, create a new record and click on "Select Expected Payments" button the value sent to the backend is @FIN_Payment_Proposal.receipt@: false 5) See the error 2483ed25 1794036 [TP-Processor3] ERROR org.openbravo.service.json.DefaultJsonDataService - java.lang.String cannot be cast to java.lang.Boolean java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean at org.hibernate.type.descriptor.java.BooleanTypeDescriptor.unwrap(BooleanTypeDescriptor.java:36) at org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$1.doBind(VarcharTypeDescriptor.java:52) at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:91) at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:282) at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:277) at org.hibernate.param.NamedParameterSpecification.bind(NamedParameterSpecification.java:67) at org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:571) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1716) at org.hibernate.loader.Loader.doQuery(Loader.java:801) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) at org.hibernate.loader.Loader.doList(Loader.java:2533) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276) at org.hibernate.loader.Loader.list(Loader.java:2271) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at org.openbravo.dal.service.OBQuery.list(OBQuery.java:115) | |||||||
Steps To Reproduce | 1) As system admin mark FIN_Payment_Proposal.Isreceipt column as stored in session. 2) As system admin go to "Payment Proposal Pick and Edit Lines" window 2.1) Edit the "Pick and Edit Lines" tab whereclause replace e.salesTransaction = false for e.salesTransaction = @FIN_Payment_Proposal.receipt@ 3) compile 4) Go to Payment Proposal window, create a new record and click on "Select Expected Payments" button the value sent to the backend is @FIN_Payment_Proposal.receipt@: false 5) See the error 2483ed25 1794036 [TP-Processor3] ERROR org.openbravo.service.json.DefaultJsonDataService - java.lang.String cannot be cast to java.lang.Boolean java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean at org.hibernate.type.descriptor.java.BooleanTypeDescriptor.unwrap(BooleanTypeDescriptor.java:36) at org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$1.doBind(VarcharTypeDescriptor.java:52) at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:91) at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:282) at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:277) at org.hibernate.param.NamedParameterSpecification.bind(NamedParameterSpecification.java:67) at org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:571) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1716) at org.hibernate.loader.Loader.doQuery(Loader.java:801) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) at org.hibernate.loader.Loader.doList(Loader.java:2533) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276) at org.hibernate.loader.Loader.list(Loader.java:2271) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at org.openbravo.dal.service.OBQuery.list(OBQuery.java:115) | |||||||
Proposed Solution | the following workaround works: e.salesTransaction = (case when @FIN_Payment_Proposal.receipt@='true' then 'Y' else 'N' end) | |||||||
Tags | No tags attached. | |||||||
Attached Files | ![]() | |||||||
![]() |
|
![]() |
|
(0058294) hgbot (developer) 2013-04-28 09:56 |
Repository: erp/devel/pi Changeset: 5e5dd4a8b5c000c0f6ae0f1e8469cd7b6c708200 Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com> Date: Sun Apr 28 12:45:45 2013 +0530 URL: http://code.openbravo.com/erp/devel/pi/rev/5e5dd4a8b5c000c0f6ae0f1e8469cd7b6c708200 [^] Fixes Issue 0023538: Tab whereclause not resolving properly Tab whereclause now resolves properly comparations of YesNo (boolean) reference columns.Type casted the typedParameter to boolean when substituting the value. --- M modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java --- |
(0058312) hudsonbot (viewer) 2013-04-29 19:37 |
A changeset related to this issue has been promoted main and to the Central Repository, after passing a series of tests. Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/10fc6569028b [^] Maturity status: Test |
(0058331) hgbot (developer) 2013-04-30 11:10 |
Repository: erp/devel/pi Changeset: c29fbfed2534706ce58c0bd3b2abc038e1f748eb Author: Asier Lostalé <asier.lostale <at> openbravo.com> Date: Tue Apr 30 11:09:35 2013 +0200 URL: http://code.openbravo.com/erp/devel/pi/rev/c29fbfed2534706ce58c0bd3b2abc038e1f748eb [^] backed out changest related to issue 23538 All values for paramters are treated as String, as it is not possible at this point to determine the type they should be. Converting "true" and "false" literals to boolean values can fail in case the property they are compared to is not a boolean. --- M modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java --- |
(0058332) alostale (viewer) 2013-04-30 11:14 |
This is not going to be changed. The proposed fix assumed "true" and "false" literals are always boolean doing the conversion based on that. This causes an API change (if a query uses the workaround explained in the use, it would stop working after the fix). The problem is at the evaluation point it is not possible to determine for a parameter which is the type it should take and guessing it can cause problems. In addition, other types are not converted from String. For example in the same query, dates are passed as String and transformed within the query itself. |
(0058390) hudsonbot (viewer) 2013-04-30 21:05 |
A changeset related to this issue has been promoted main and to the Central Repository, after passing a series of tests. Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/3ea22ca7a348 [^] Maturity status: Test |
![]() |
|||
Date Modified | Username | Field | Change |
2013-04-12 10:30 | mirurita | New Issue | |
2013-04-12 10:30 | mirurita | Assigned To | => AugustoMauch |
2013-04-12 10:30 | mirurita | Modules | => Core |
2013-04-12 10:30 | mirurita | OBNetwork customer | => No |
2013-04-12 10:30 | mirurita | Triggers an Emergency Pack | => No |
2013-04-16 11:59 | shankarb | Assigned To | AugustoMauch => shankarb |
2013-04-23 10:17 | shankarb | File Added: 23538.diff | |
2013-04-28 08:40 | shankarb | Issue Monitored: AugustoMauch | |
2013-04-28 08:40 | shankarb | Review Assigned To | => AugustoMauch |
2013-04-28 08:40 | shankarb | Status | new => scheduled |
2013-04-28 08:40 | shankarb | fix_in_branch | => pi |
2013-04-28 09:56 | hgbot | Checkin | |
2013-04-28 09:56 | hgbot | Note Added: 0058294 | |
2013-04-28 09:56 | hgbot | Status | scheduled => resolved |
2013-04-28 09:56 | hgbot | Resolution | open => fixed |
2013-04-28 09:56 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/5e5dd4a8b5c000c0f6ae0f1e8469cd7b6c708200 [^] |
2013-04-29 19:37 | hudsonbot | Checkin | |
2013-04-29 19:37 | hudsonbot | Note Added: 0058312 | |
2013-04-30 11:10 | hgbot | Checkin | |
2013-04-30 11:10 | hgbot | Note Added: 0058331 | |
2013-04-30 11:10 | alostale | Status | resolved => new |
2013-04-30 11:10 | alostale | Resolution | fixed => open |
2013-04-30 11:14 | alostale | Review Assigned To | AugustoMauch => alostale |
2013-04-30 11:14 | alostale | Note Added: 0058332 | |
2013-04-30 11:14 | alostale | Status | new => closed |
2013-04-30 11:14 | alostale | Resolution | open => no change required |
2013-04-30 21:05 | hudsonbot | Checkin | |
2013-04-30 21:05 | hudsonbot | Note Added: 0058390 |
Copyright © 2000 - 2009 MantisBT Group |