Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0038512Openbravo ERPA. Platformpublic2018-05-10 09:232018-05-10 13:42
caristu 
platform 
highminorhave not tried
closedfixed 
5
 
 
caristu
Core
No
0038512: OBQuery can fail using objects from OBContext as parameters
OBQuery can fail using objects from OBContext as parameters.
1) Apply the attached patch (obquery.diff)
2) Log-in
3) Open the About pop-up. The query fails, showing the following error trace:

ERROR org.openbravo.erpCommon.ad_forms.About - Error captured:
org.hibernate.MappingException: Unknown entity: org.openbravo.model.ad.system.Client
    at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:694)
    at org.hibernate.impl.SessionFactoryImpl.getIdentifierType(SessionFactoryImpl.java:781)
    at org.hibernate.type.EntityType.getIdentifierType(EntityType.java:560)
    at org.hibernate.type.EntityType.getIdentifierOrUniqueKeyType(EntityType.java:585)
    at org.hibernate.type.ManyToOneType.nullSafeSet(ManyToOneType.java:130)
    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)

4) Note that when building the same query (with the same parameter) using OBCriteria, it can be executed properly (see attached obcriteria.diff)
No tags attached.
depends on feature request 0037064 closed caristu upgrade hibernate to 5.3.2 
diff obquery.diff (1,463) 2018-05-10 09:23
https://issues.openbravo.com/file_download.php?file_id=11787&type=bug
diff obcriteria.diff (1,644) 2018-05-10 09:25
https://issues.openbravo.com/file_download.php?file_id=11788&type=bug
Issue History
2018-05-10 09:23caristuNew Issue
2018-05-10 09:23caristuAssigned To => platform
2018-05-10 09:23caristuFile Added: obquery.diff
2018-05-10 09:23caristuModules => Core
2018-05-10 09:23caristuTriggers an Emergency Pack => No
2018-05-10 09:25caristuFile Added: obcriteria.diff
2018-05-10 09:26caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=17107#r17107
2018-05-10 09:28caristuRelationship addedrelated to 0037064
2018-05-10 09:31caristuNote Added: 0104443
2018-05-10 09:31caristuNote Edited: 0104443bug_revision_view_page.php?bugnote_id=0104443#r17109
2018-05-10 09:42caristuTypedefect => design defect
2018-05-10 09:42caristuRelationship deletedrelated to 0037064
2018-05-10 09:42caristuRelationship addeddepends on 0037064
2018-05-10 13:42caristuReview Assigned To => caristu
2018-05-10 13:42caristuNote Added: 0104452
2018-05-10 13:42caristuStatusnew => closed
2018-05-10 13:42caristuResolutionopen => fixed

Notes
(0104443)
caristu   
2018-05-10 09:31   
Note that this problem can't be reproduced with hibernate 5.3.0.CR2[1]. So, this issue will be fixed with the hibernate upgrade.

[1] https://code.openbravo.com/erp/devel/pi-hb53 [^]

(0104452)
caristu   
2018-05-10 13:42   
Fixed with 0037064