Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021426Openbravo ERPA. Platformpublic2012-08-23 09:102012-08-29 17:14
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
3.0MP153.0MP15 
marvintm
Core
No
0021426: Adding computed property in a view gives an error in the hibernate mapping
When adding a property to a view you get an error in the hibernate mapping:

export.database:

export.database.structure:
Initializing in-memory model...
Building runtime model
Model read in-memory, generating mapping...
Error parsing XML (3827) : Attribute "update" was already specified for element "property".
Unable to read XML



The wrong mapping (see the 2 occurrences of the update property):
        <property name="eGOB" access="org.openbravo.dal.core.OBDynamicPropertyHandler" type="java.lang.String" formula="(SELECT CASE WHEN i.posted = 'Y' THEN 'Yes' ELSE 'No' END from
aprm_finacc_transaction_v AS i WHERE i.aprm_finacc_transaction_v_ID =
aprm_finacc_transaction_v_id)" update="false" insert="false" update="false" insert="false"/>


Add a computed property to a view and then do export.database or another dal related task.

http://wiki.openbravo.com/wiki/How_to_create_a_Computed_Column [^]
No tags attached.
Issue History
2012-08-23 09:10mtaalNew Issue
2012-08-23 09:10mtaalAssigned To => mtaal
2012-08-23 09:10mtaalModules => Core
2012-08-23 09:19mtaalNote Added: 0051480
2012-08-23 09:20mtaalClosed by => marvintm
2012-08-23 09:30hgbotCheckin
2012-08-23 09:30hgbotNote Added: 0051481
2012-08-23 09:30hgbotCheckin
2012-08-23 09:30hgbotNote Added: 0051482
2012-08-23 09:30hgbotStatusnew => resolved
2012-08-23 09:30hgbotResolutionopen => fixed
2012-08-23 09:30hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/83a3b7b37c1d5766a00716d89e7de590c9c2ff52 [^]
2012-08-29 17:14marvintmStatusresolved => closed
2012-08-29 17:14marvintmFixed in Version => 3.0MP15

Notes
(0051480)
mtaal   
2012-08-23 09:19   
Note the module org.openbravo.client.application.example in mercurial adds a computed property to a view for testing this. The view is ProductStockView and the column name is EM_OBEXAPP_productName.
(0051481)
hgbot   
2012-08-23 09:30   
Repository: erp/mods/org.openbravo.client.application.examples
Changeset: fab924c3f431ccaa16ea66e8f0d2e1d7334dd5a2
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Thu Aug 23 09:21:47 2012 +0200
URL: http://code.openbravo.com/erp/mods/org.openbravo.client.application.examples/rev/fab924c3f431ccaa16ea66e8f0d2e1d7334dd5a2 [^]

Related to issue 21426: Adding computed property in a view gives an error in the hibernate mapping
Added computed property to a view for testing this issue

---
M src-db/database/sourcedata/AD_COLUMN.xml
---
(0051482)
hgbot   
2012-08-23 09:30   
Repository: erp/devel/pi
Changeset: 83a3b7b37c1d5766a00716d89e7de590c9c2ff52
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Thu Aug 23 09:29:56 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/83a3b7b37c1d5766a00716d89e7de590c9c2ff52 [^]

Fixes issue 21426: Adding computed property in a view gives an error in the hibernate mapping
Cleaned up the generation of the update/insert properties in the dalmappinggenerator
so that no clashes occur anymore.

---
M src/org/openbravo/dal/core/DalMappingGenerator.java
---