JPA: for the generated static metamodel, for example,
@Entity
public class Foo {
private Long id;
}
@StaticMetamodel(...)
public class Foo_ {
public static volatile SingleAttribute<Foo, Long> id;
}
If the entity class Foo is in multiple persistence units(each persistence unit has a Metamodel), each Metamodel has a different ManagedType
instance for the Foo class. which metamodel does the static attributes (e.g. id in the example) belong? Each attribute has method getDeclaringType()
which returns ManagedType
.