Project:
View Revisions: Issue #24495 | [ Back to Issue ] | ||
Summary | 0024495: Lazy computed columns API chage | ||
Revision | 2013-08-07 14:27 by alostale | ||
Description | Fix for issue 0024104 makes computed columns to be lazily calculated. As part of this fix, generated code for DAL entities has renamed properties for computed columns in order to prevent accidental filtering by them which would cause performance issues. NOTE: Computed columns cannot be used as part of Criterias anymore. The properties for computed columns present in core that have been removed are (see http://builds.openbravo.com/view/try/job/try-api/1527/console [^]): org.openbravo.model.common.order: Missing field org.openbravo.model.common.order.Order.PROPERTY_DELIVERYSTATUS: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.common.order.Order.PROPERTY_INVOICESTATUS: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 org.openbravo.model.financialmgmt.calendar: Missing field org.openbravo.model.financialmgmt.calendar.Period.PROPERTY_STATUS: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 org.openbravo.model.financialmgmt.payment: Missing field org.openbravo.model.financialmgmt.payment.DoubtfulDebt.PROPERTY_OUTSTANDINGDOUBTFULDEBTAMOUNT: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount.PROPERTY_LASTRECONBALANCE: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount.PROPERTY_LASTRECONCILIATION: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.financialmgmt.payment.FIN_PaymentProposal.PROPERTY_LIMITWRITEOFF: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.financialmgmt.payment.FIN_PaymentSchedule.PROPERTY_DAYSOVERDUE: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.financialmgmt.payment.FIN_PaymentSchedule.PROPERTY_LASTPAYMENTDATE: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.financialmgmt.payment.FIN_PaymentSchedule.PROPERTY_NUMBEROFPAYMENTS: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.financialmgmt.payment.FIN_PaymentSchedule.PROPERTY_TOTALDEBTAMOUNT: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 org.openbravo.model.manufacturing.transaction: Missing field org.openbravo.model.manufacturing.transaction.WorkRequirement.PROPERTY_CLOSEDSTAT: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 org.openbravo.model.materialmgmt.transaction: Missing field org.openbravo.model.materialmgmt.transaction.ShipmentInOut.PROPERTY_INVOICESTATUS: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 + failure=1 It also changes the way computed columns can be queried using HQL. In case computed columns are needed to be accessed from HQL, they are not directly available but through the _computedColumns property. As example, this HQL: from Order o where o.deliveredStatus = 100 should be rewritten to: from Order o where o._computedColumns.deliveredStatus = 100 Note this kind of queries should be reviewed not only because of the API change but also because they can cause performance problems. The naming of computed columns properties in generated code code be preserved to the old one not making an API change, but this is not the case for HQL. Also code making use of these proeprties should be reviewed because it is potentially harmful in terms of performance. This is the reason this API change in the generated code has been intentionally introduced. |
||
Revision | 2013-08-07 09:42 by alostale | ||
Description | Fix for issue 0024104 makes computed columns to be lazily calculated. As part of this fix, generated code for DAL entities has renamed properties for computed columns in order to prevent accidental filtering by them which would cause performance issues. The properties for computed columns present in core that have been removed are (see http://builds.openbravo.com/view/try/job/try-api/1527/console [^]): org.openbravo.model.common.order: Missing field org.openbravo.model.common.order.Order.PROPERTY_DELIVERYSTATUS: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.common.order.Order.PROPERTY_INVOICESTATUS: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 org.openbravo.model.financialmgmt.calendar: Missing field org.openbravo.model.financialmgmt.calendar.Period.PROPERTY_STATUS: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 org.openbravo.model.financialmgmt.payment: Missing field org.openbravo.model.financialmgmt.payment.DoubtfulDebt.PROPERTY_OUTSTANDINGDOUBTFULDEBTAMOUNT: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount.PROPERTY_LASTRECONBALANCE: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount.PROPERTY_LASTRECONCILIATION: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.financialmgmt.payment.FIN_PaymentProposal.PROPERTY_LIMITWRITEOFF: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.financialmgmt.payment.FIN_PaymentSchedule.PROPERTY_DAYSOVERDUE: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.financialmgmt.payment.FIN_PaymentSchedule.PROPERTY_LASTPAYMENTDATE: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.financialmgmt.payment.FIN_PaymentSchedule.PROPERTY_NUMBEROFPAYMENTS: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 field org.openbravo.model.financialmgmt.payment.FIN_PaymentSchedule.PROPERTY_TOTALDEBTAMOUNT: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 org.openbravo.model.manufacturing.transaction: Missing field org.openbravo.model.manufacturing.transaction.WorkRequirement.PROPERTY_CLOSEDSTAT: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 org.openbravo.model.materialmgmt.transaction: Missing field org.openbravo.model.materialmgmt.transaction.ShipmentInOut.PROPERTY_INVOICESTATUS: missing in /srv/hudson/workspace/try-full-oracle/SANDBOX/api-checks/output/1527 + failure=1 It also changes the way computed columns can be queried using HQL. In case computed columns are needed to be accessed from HQL, they are not directly available but through the _computedColumns property. As example, this HQL: from Order o where o.deliveredStatus = 100 should be rewritten to: from Order o where o._computedColumns.deliveredStatus = 100 Note this kind of queries should be reviewed not only because of the API change but also because they can cause performance problems. The naming of computed columns properties in generated code code be preserved to the old one not making an API change, but this is not the case for HQL. Also code making use of these proeprties should be reviewed because it is potentially harmful in terms of performance. This is the reason this API change in the generated code has been intentionally introduced. |
Copyright © 2000 - 2009 MantisBT Group |