1

Why is the JPA metamodel using 'static volatile'? Is this not bad for performance?

I understand that this generated metamodel is only used for type-save validation at compile time. No real values exist in this object. What didn't I understand?

package domain;
import javax.persistence.metamodel.SingularAttribute;

@javax.persistence.metamodel.StaticMetamodel(domain.Person.class)

public class Person_ {
  public static volatile SingularAttribute<Person,Long> ssn;
  public static volatile SingularAttribute<Person,String> name;
  public static volatile SingularAttribute<Person,Integer> age;
}
Dimitri Dewaele
  • 10,311
  • 21
  • 80
  • 127

0 Answers0