Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0052859
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajorhave not tried2023-06-27 12:512023-07-08 00:55
ReporterAugustoMauchView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in VersionPR23Q4
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0052859: It is not possible to have computed columns both in m_product and m_offer_product

DescriptionIf we try to have computed columns both in the m_product and m_offer_product tables, the datasource response for both of those tables will fail.

For m_product:
- java.lang.ClassCastException: class org.openbravo.model.pricing.priceadjustment.Product_ComputedColumns$HibernateProxy$GcoEEn1j cannot be cast to class org.openbravo.model.common.plm.Product_ComputedColumns (org.openbravo.model.pricing.priceadjustment.Product_ComputedColumns$HibernateProxy$GcoEEn1j and org.openbravo.model.common.plm.Product_ComputedColumns are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @51e7ffe5)

For m_offer_product:
- org.openbravo.base.util.CheckException: Property testOffer does not exist for entity Product_ComputedColumns

The cause is that when generating the entities for the computed columns, the names of the entities are built using <className>_ComputedColumns, and the name for both m_product and m_offer_product classes is Product, resulting in two entities with the same name (Product_ComputedColumn).
Steps To Reproduce- Add computed columns (and fields) to both m_product and m_offer_product. You can use the same sql logic in both of them: select m_productprice.m_productprice_id from m_productprice where m_productprice.m_product_id=m_product_id limit 1, create a String column.
- Compile the application, restart tomcat
- Open the Product window. The following error will be thrown: java.lang.ClassCastException: class org.openbravo.model.pricing.priceadjustment.Product_ComputedColumns$HibernateProxy$GcoEEn1j cannot be cast to class org.openbravo.model.common.plm.Product_ComputedColumns
- Open Discounts and Promotions, select a record, select the Products tab. The following error will be thrown: org.openbravo.base.util.CheckException: Property testOffer does not exist for entity Product_ComputedColumns
Proposed SolutionWhen building the entities of the computed column, use the entity name of the original entity as prefix (guaranteed to be unique) instead of the class name (not guaranteed)
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
has duplicate defect 0052606 closedTriage Platform Base Unable to create a computed column for m_offer_product table 

-  Notes
(0151669)
hgbot (developer)
2023-06-27 12:55

Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/921 [^]
(0152202)
hgbot (developer)
2023-07-08 00:53

Merge Request created: https://gitlab.com/openbravo/ci/backoffice-api/-/merge_requests/44 [^]
(0152203)
hgbot (developer)
2023-07-08 00:54

Merge request merged: https://gitlab.com/openbravo/ci/backoffice-api/-/merge_requests/44 [^]
(0152204)
hgbot (developer)
2023-07-08 00:54

Repository: https://gitlab.com/openbravo/ci/backoffice-api [^]
Changeset: 6c16c98809824d1fef653f92161c9db2255b4146
Author: Javier Armendáriz <javier.armendariz@openbravo.com>
Date: 08-07-2023 00:52:37
URL: https://gitlab.com/openbravo/ci/backoffice-api/-/commit/6c16c98809824d1fef653f92161c9db2255b4146 [^]

Related to ISSUE-52859 API Change: Changed name of computed columns constants

---
M java/reference/java.japi.gz
---
(0152205)
hgbot (developer)
2023-07-08 00:55

Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/921 [^]
(0152206)
hgbot (developer)
2023-07-08 00:55

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: cc662cc2242a424fbfca16af9a9ece7292ae3968
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 07-07-2023 21:08:49
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/cc662cc2242a424fbfca16af9a9ece7292ae3968 [^]

Fixes ISSUE-52859: The name of computed columns entities are not guaranteed to be unique.

The problem is that when generating the entities for the computed columns, we names of the entities are built using <className>_ComputedColumns, and the name for both m_product and m_offer_product classes is Product, resulting in two entities with the same name (Product_ComputedColumn).

To fix it, the name of the entities generated for the computed columns, the original entity name (guaranteed to be unique) will be used as prefix instead of the class name (not guaranteed).

Note that this change is an API change due to the name of the computed column entities being updated.

---
M src/org/openbravo/base/gen/entityComputedColumns.ftl
M src/org/openbravo/base/model/Entity.java
M src/org/openbravo/dal/core/DalMappingGenerator.java
---

- Issue History
Date Modified Username Field Change
2023-06-27 12:51 AugustoMauch New Issue
2023-06-27 12:51 AugustoMauch Assigned To => AugustoMauch
2023-06-27 12:51 AugustoMauch Modules => Core
2023-06-27 12:51 AugustoMauch Triggers an Emergency Pack => No
2023-06-27 12:51 AugustoMauch Status new => scheduled
2023-06-27 12:55 hgbot Note Added: 0151669
2023-06-27 15:08 Practics Issue Monitored: Practics
2023-06-27 18:14 AugustoMauch Relationship added has duplicate 0052606
2023-06-28 10:05 AugustoMauch Description Updated View Revisions
2023-07-08 00:53 hgbot Note Added: 0152202
2023-07-08 00:54 hgbot Note Added: 0152203
2023-07-08 00:54 hgbot Note Added: 0152204
2023-07-08 00:55 hgbot Note Added: 0152205
2023-07-08 00:55 hgbot Resolution open => fixed
2023-07-08 00:55 hgbot Status scheduled => closed
2023-07-08 00:55 hgbot Fixed in Version => PR23Q4
2023-07-08 00:55 hgbot Note Added: 0152206


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker