0

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.

eastwater
  • 4,624
  • 9
  • 49
  • 118
  • A static query class is created ONCE for an entity, so an entity class corresponds to a static query class. It can be USED BY any persistence unit that needs it. No idea what you mean beyond that. –  Jan 19 '18 at 10:49
  • what is the static query class? metamodel class? – eastwater Jan 19 '18 at 18:52
  • The class with the "_". –  Jan 19 '18 at 19:21

0 Answers0