Do Annotations pass on to the extended/mixer type?

#1

I have 3 types:

  • MyType1 that has an annotation, e.g. @db
  • MyType2 that extends MyType1
  • MyType3 that mixes in MyType1

Will MyType2 and MyType3 have the annotation too?

#2

yes they will also have the annotation

#3

When you call extensions() on a type by default you get all the inherited extensions from the parent types too. There is a way to refer to the extensions on the type itself (and not inherited) via declaredExtensions() call on the type

#4

We are not seeing this in the extensions API call. In Boaz’s example if we call MyType3.extensions() it shows MyType3’s annotations and some from being an entity type but does not show the annotation from MyType1.

In our scenario MyType1 is a non-entity type and MyType3 is an entity type.

#5

If you have a code example you can provide we will file the bug.

#6

@rileysiebel Here is an example of the problem that @brett.thompson and I are seeing:


We can see that StageInpatientHeader does not mixin the hisType annotation that exists on InpatientHeader

#7

Thanks.

I have filed this bug. For now, you might have to traverse the hierarchy yourself…

StageInpatientHeader.mixin('InpatientHeader').extensions()

FYI in the java typesystem we confirmed the annotation from the mixin is correctly inherited.