我正在使用 jpql。
但我无法创建查询,因为“tgDeclarationRglts”是一个“列表”。
如何在查询中访问此列表以检索“idDeclarationRglt”?
谢谢 !
“DeclarationRglt”实体
@Id
@SequenceGenerator(name="DECREG_IDDECLARATION_RGLT", sequenceName="SID_DECLARATION_RGLT" , allocationSize = 1)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="DECREG_IDDECLARATION_RGLT")
@Column(name="ID_DECLARATION_RGLT")
private long idDeclarationRglt;
“LigneDipRec”实体
//bi-directional many-to-many association to TgDeclarationRglt
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(
name="TG_DIP_RECOUVREMENT"
, joinColumns={
@JoinColumn(name="ID_LIGNE_DIP_REC")
}
, inverseJoinColumns={
@JoinColumn(name="ID_DECLARATION_RGLT")
}
)
private List<DeclarationRglt> tgDeclarationRglts;
这是我的查询:
select distinct ta3.idTitre from LigneTa3 ta3, DeclarationRglt dec where ta3.tgDeclarationRglt.idDeclarationRglt =:idDecReg and dec.tcTypeDeclarationRglt.cdTypeDeclaration =:typeDec