The fix for the issue
HHH-9305
breaks following criteria statement:
{{CriteriaBuilder builder = getEM().getCriteriaBuilder(); CriteriaQuery<MFLeistArt> query = builder.createQuery(MFLeistArt.class); Root<MFLeistArt> root = query.from(MFLeistArt.class);
Predicate predicate = builder.and(builder.equal(root.get(MFLeistArt_.gruppe), group)); Join<MFLeistArt, MFLeistArtDet> leistartJoin = root.join(MFLeistArt_.leistart); predicate.getExpressions().add(builder.equal(leistartJoin.get(MFLeistArtDet_.art), "NL-TAG"));
query.where(predicate); query.orderBy(builder.asc(leistartJoin.get(MFLeistArtDet_.name))); root.fetch(MFLeistArt_.leistart); root.fetch(MFLeistArt_.gruppe); return getEM().createQuery(query).getResultList(); }}
Generated SQL Statement before
HHH-9305
: {{select mfleistart0_.id as id1_41_0_, mfleistart2_.id as id1_42_1_, mfgruppe3_.id as id1_34_2_, mfleistart0_.gruppe as gruppe4_41_0_, mfleistart0_.leistart as leistart5_41_0_, mfleistart0_.organisation as organisation2_41_0_, mfleistart0_.von as von3_41_0_, mfleistart2_.art as art2_42_1_, mfleistart2_.auswahl as auswahl3_42_1_, mfleistart2_.farbcode as farbcode4_42_1_, mfleistart2_.kode as kode5_42_1_, mfleistart2_.kunde as kunde6_42_1_, mfleistart2_.kurz as kurz7_42_1_, mfleistart2_.name as name8_42_1_, mfleistart2_.position as position9_42_1_, mfleistart2_.von as von10_42_1_, mfgruppe3_.name as name2_34_2_, mfgruppe3_.nummer as nummer3_34_2_, mfgruppe3_.von as von4_34_2_ from mfleistart mfleistart0_ inner join mfleistartdet mfleistart1_ on mfleistart0_.leistart=mfleistart1_.id inner join mfleistartdet mfleistart2_ on mfleistart0_.leistart=mfleistart2_.id inner join mfgruppe mfgruppe3_ on mfleistart0_.gruppe=mfgruppe3_.name where mfleistart0_.gruppe=? and mfleistart1_.art=? order by mfleistart1_.name asc}}
{{With fix for
HHH-9305
: select mfleistart0_.id as id1_41_0_, mfgruppe3_.id as id1_34_1_, mfleistart0_.gruppe as gruppe4_41_0_, mfleistart0_.leistart as leistart5_41_0_, mfleistart0_.organisation as organisation2_41_0_, mfleistart0_.von as von3_41_0_, mfgruppe3_.name as name2_34_1_, mfgruppe3_.nummer as nummer3_34_1_, mfgruppe3_.von as von4_34_1_ from mfleistart mfleistart0_ inner join mfleistartdet mfleistart1_ on mfleistart0_.leistart=mfleistart1_.id inner join mfgruppe mfgruppe3_ on mfleistart0_.gruppe=mfgruppe3_.name where mfleistart0_.gruppe=? and mfleistart1_.art=? order by mfleistart1_.name asc}}
The second statement misses the fetched properties from mfleistartdet table.
|