JPQL in Loader does not work. I need help!

Hi!
Please, help find bug.

I have message:
…query hint eclipselink.left-join-fetch is not valid for this type of query.

This is code of loader:

   _<loader id="stockChangesLoader">_

_ _
_ _
_ _
_ _

This is entities:

_ Table(name = “stock_changes”)_
_ Entity(name = “itdogovorolapdemo_StockChanges”)_
public class StockChanges extends BaseIntIdentityIdEntity {
_ private static final long serialVersionUID = -5555494538495520348L;_

_ ManyToOne(fetch = FetchType.LAZY, optional = false)_
_ JoinColumn(name = “id_dep”)_
_ protected Dep idDep;_


_ Table(name = “dep”)_
_ Entity(name = “itdogovorolapdemo_Dep”)_
public class Dep extends BaseIntegerIdEntity {
_ ManyToOne(fetch = FetchType.LAZY)_
_ JoinColumn(name = “id_parent”)_
_ protected Dep idParent;_

_ Column(name = “name_dep”, nullable = false, length = 64)_
_ protected String nameDep;_

Hi @urjadovaa

Please share you JPQL query to be able to understand what’s wrong.

Regards,
Daniil

Daniil, JPQL query:

select e.idDep.nameDep as idDep, sum(e.signedSumUsd) as signedSumUsd
from proj_StockChanges e group by e.idDep.nameDep

Both entities are located in Additional data store.

You get this exception because you are trying to load scalar values and aggregates into a regular data container. Instance and Collection containers can be used only for entities, i.e. select e from demo_Foo e.
If you need scalar values, use KeyValue Containers or load data using DataManager.loadValues() method.

Konstantin, thank you!