hibernate - JPQL query - how to access a list -
i using jpql.
but having trouble creating query because "tgdeclarationrglts" "list".
how can access list in query retrieve "iddeclarationrglt" ?
thank !
the "declarationrglt" entity
@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;
the "lignediprec" entity
//bi-directional many-to-many association 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;
here query :
select distinct ta3.idtitre ligneta3 ta3, declarationrglt dec ta3.tgdeclarationrglt.iddeclarationrglt =:iddecreg , dec.tctypedeclarationrglt.cdtypedeclaration =:typedec
it quite difficult understand question since query using entity called ligneta3 have not provided.
if purely @ part of question:
how can access list in query retrieve "iddeclarationrglt"?
then think looking based on:
select d.iddeclarationrglt lignediprec l join l.tgdeclarationrglts d
that shows general approach accessing every element of collection, can use approach in bigger query.
Comments
Post a Comment