| we have
@Entity
public class Goods {
@Id
private Long id;
@OneToMany
private List<Product> productList;
@Convert(converter = StringToListConverter.class)
private List<String> tags;
}
which create Goods_ after compile:
@StaticMetamodel(Goods.class)
public abstract class Goods_ {
public static volatile SingularAttribute<Goods, Long> id;
public static volatile ListAttribute<Goods, Product> productList;
public static volatile ListAttribute<Goods, String> tags;
}
when we use Goods_.productList to create a path corresponding
get the NullPointerException error:
java.lang.NullPointerException
at org.eclipse.persistence.internal.jpa.metamodel.proxy.AttributeProxyImpl.getName(AttributeProxyImpl.java:73)
at org.eclipse.persistence.internal.jpa.querydef.FromImpl.get(FromImpl.java:285)
but if we use root.get("tags") ,it runs correct. In fact, Goods.tags has no reationship with other entity, we should treade it as a basic attribute,and get this:
public static volatile SingularAttribute<Goods, List<String>> tags;
|