You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Benjamin Jugl (Jira)" <ji...@apache.org> on 2021/02/19 15:16:00 UTC

[jira] [Commented] (OFBIZ-12178) ModelInduceFromDb does not show entity relations.

    [ https://issues.apache.org/jira/browse/OFBIZ-12178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17287117#comment-17287117 ] 

Benjamin Jugl commented on OFBIZ-12178:
---------------------------------------

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.

> ModelInduceFromDb does not show entity relations.
> -------------------------------------------------
>
>                 Key: OFBIZ-12178
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-12178
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 18.12, Trunk
>            Reporter: Benjamin Jugl
>            Assignee: Benjamin Jugl
>            Priority: Minor
>
> As encountered in OFBIZ-6510, the ModelInduceFromDb does currently not include entity relations and foreign key constraints. Since they are an important part of the database model, we should fix that.
> I could track down the problem to an incomplete invocation of the ModelEntity through the constructor used in the DatabaseUtil.induceModelFromDb() Methods. This constructor does not initialize the Relations.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)