fieldenms / tg

Trident Genesis
MIT License
14 stars 7 forks source link

Property "desc" and "id" are not metamodeled for some entities that extend another metamodeled entity #1898

Closed homedirectory closed 1 year ago

homedirectory commented 1 year ago

Description

Currently property desc should be metamodeled only when an entity is annotated with @DescTitle or it declares property desc. Also, generated meta-models reflect the hierarchical structure of their underlying entities, i.e., meta-model of a subtype extends the meta-model of a supertype.

More specifically, there are 2 cases where entity meta-models should include desc:

  1. @DescTitle is present directly for an entity or one of its super types.
  2. Property desc is declared in an entity type or its super types, with the exclusion of AbstractEntity (where it is declared presently).

A special case was observed when property desc was erroneously omitted from generation. Specifically, it happens when a metamodeled entity declares @DescTitle, while its metamodeled parent entity does not. For example:

class EntityA extends AbstractEntity<String> {}

@DescTitle
class EntityB extends EntityA {}

Both meta-models would be missing property desc, while it is expected of the meta-model for EntityB to have it.

Expected outcome

Property desc is metamodeled for all entities that are either annotated with @DescTitle or declare property desc.

homedirectory commented 1 year ago

Note: if #1877 gets merged before this branch, then a conflict will have to be resolved on this branch.

01es commented 1 year ago

Note: if #1877 gets merged before this branch, then a conflict will have to be resolved on this branch.

@homedirectory, I think it is best if we could stack this up -- first merge #1877 and then this issue. Hence, please merge Issue-#1877 into the branch for this issue and change the base for https://github.com/fieldenms/tg/pull/1899 to be Issue-#1877.