You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Benjamin Jugl <be...@ecomify.de> on 2021/02/19 15:15:31 UTC

Incomplete Initialisation of ModelEntity via DB-Constructor

Hello everybody,

while working on Issue OFBIZ-6510 
<https://issues.apache.org/jira/browse/OFBIZ-6510>, converting the 
ModelInduceFromDb functionality from JSP to widgets, we found that the 
references are not represented in the induced XMLs. This led directly to 
Issue OFBIZ-12178 <https://issues.apache.org/jira/browse/OFBIZ-12178>, 
which I am currently working on.

Problem is, that the ModelEntity initialized through the "DB Names 
Constructor" does not cover references in its current state at all.

While working on an implementation I realized, that the API is not very 
congruent in this regards. I would expect that I could initialize 
ModelRelations the same way ModelFields are initialized in this context:

The create() Method takes a ModelEntity, DatabaseUtil.ColumnCheckInfo 
(respectively a DatabaseUtil.ReferenceCheckInfo) and a  
ModelFieldTypeReader (that could be left out for references) and creates 
ModelField (ModelRelation) objects that are added to the ModelEntity.

But that is not the case at the moment. On one hand not all fields that 
would be necessary are covered in the DatabaseUtil.ReferenceCheckInfo 
Objects (e.g. "type" is missing), on the other the object is missing 
public getters to make the values available in the first place.


Is there some knowledge, why this had been done like this? Shall I 
implement a more congruent structure that will lead to a complete 
initialisation of ModelRelation objects in this context? Or was that 
design on purpose and there was a sound reason to leave this out?


Kind regards,

Benjamin