cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <>
Subject [jira] [Commented] (CAY-2113) cdbimport: Reverse-engineering reinstates previously ignored columns
Date Wed, 28 Sep 2016 14:02:20 GMT


Andrus Adamchik commented on CAY-2113:

The cause is the following code in AbstractToModelToken class (called from subclasses) :

 public void execute(MergerContext mergerContext) {

Here 'synchronizeWithObjEntity' is called for the entire DbEntity, regardless of the scope
of the token change. So it overrides custom settings. And also degrades performace as 'synchronizeWithObjEntity'
is called it for every token, so it may be called multiple times for the same entity. Any
fix that replaces 'synchronizeWithObjEntity'  with token-specific code will hopefully solve
both problems. This affects the following Token classes:

* AddColumnToModel
* AddRelationshipToModel
* CreateTableToModel

> cdbimport: Reverse-engineering reinstates previously ignored columns
> --------------------------------------------------------------------
>                 Key: CAY-2113
>                 URL:
>             Project: Cayenne
>          Issue Type: Bug
>    Affects Versions: 4.0.M3
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
> Say we have a model:
> {noformat}
> T1:
>    ID
>    C1
>    C2
> O1 -> T1
>    c1 -> T1.C1
> {noformat}
> I.e. our ObjEntity intentionally does not map certain columns. Now we add a column T1.C3
and rerun cdbimport. The end result is 2 new attributes: c2 and c3. Expected - just c3. Removal
of "c2" was an earlier user decision and we should not recreate it.

This message was sent by Atlassian JIRA

View raw message