我写了以下查询。
List<Integer> lkpTerritoryIdList = null;
lkpTerritoryIdList = entityManager.createQuery("select assetTerritories from Asset a join a.assetTerritories astTerritory where a.assetId in (:assetIdListParam)")
.setParameter("assetIdListParam", assetIdList).getResultList();
在Asset.java中,assetTerritoriesd被声明为
@CollectionOfElements
@JoinTable(name = "ASSET_TERRITORY", joinColumns = @JoinColumn(name="ASSET_ID"))
@Column(name="LKP_TERRITORY")
private Set<Integer> assetTerritories = new LinkedHashSet<Integer>(0);
我得到以下异常。
java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.IdentNode
我不确定需要做些什么来纠正它。请帮朋友们。