什么是@StaticMetamodel和SingularAttribute<Obj,Obj>?
2022-09-01 13:16:12
我现在正试图弄清楚这个代码大约两个小时,例如在下面的类中,这些字段代表什么?
import java.util.Date;
import javax.persistence.metamodel.ListAttribute;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
import java.util.UUID;
@StaticMetamodel(Address.class)
public class Address_ extends {
public static volatile SingularAttribute<Address, Long> id;
public static volatile SingularAttribute<Address, UUID> personId;
public static volatile SingularAttribute<Address, Person> person;
}
是一个 java 类,它具有以下定义:Address.class
@Entity
@Table(name = "address", schema = "public")
public class Address{
private Long id;
private Person person;
private UUID personId;
//....
}
您能解释一下 注释 和 的用途吗?这可能很简单,但我无法理解。@StaticMetamodel
@SingularAttribute