How to Join two Entities of Oracle schema in cuba platform?

Hi,

I have imported two Entities from Oracle Schema and wants to write join query using those tables.

I have created new screen with valuecollectiondatasource and the query is as follows,
select distinct e.id.month, e.id.materialType, e.plant,
e.id.material, e.id.bum, e.quantity, e.confQuantity, e.altMaterial,
e.altMaterialDesc, e.availRemarks, f.materialDesc
from exporttracker$AplIbuTrackerConfirmation e
join
exporttracker$AplIbuTrackerRequirement f
on e.id.material = f.id.material and e.id.month = f.id.month

but i am getting the below error,

com.haulmont.cuba.core.global.RemoteException:

java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
Exception Description: Problem compiling [
select distinct e.id.month, e.id.materialType, e.plant,
e.id.material, e.id.bum, e.quantity, e.confQuantity, e.altMaterial,
e.altMaterialDesc, e.availRemarks, f.materialDesc
from exporttracker$AplIbuTrackerConfirmation e
join
exporttracker$AplIbuTrackerRequirement f
on e.id.material = f.id.material and e.id.month = f.id.month
].
[16, 26] The state field path ‘e.id.month’ cannot be resolved to a valid type.
[28, 45] The state field path ‘e.id.materialType’ cannot be resolved to a valid type.
[47, 54] The state field path ‘e.plant’ cannot be resolved to a valid type.
[56, 69] The state field path ‘e.id.material’ cannot be resolved to a valid type.
[71, 79] The state field path ‘e.id.bum’ cannot be resolved to a valid type.
[81, 91] The state field path ‘e.quantity’ cannot be resolved to a valid type.
[93, 107] The state field path ‘e.confQuantity’ cannot be resolved to a valid type.
[109, 122] The state field path ‘e.altMaterial’ cannot be resolved to a valid type.
[124, 141] The state field path ‘e.altMaterialDesc’ cannot be resolved to a valid type.
[143, 157] The state field path ‘e.availRemarks’ cannot be resolved to a valid type.
[159, 173] The state field path ‘f.materialDesc’ cannot be resolved to a valid type.
[179, 218] The abstract schema type ‘exporttracker$AplIbuTrackerConfirmation’ is unknown.
[226, 264] The abstract schema type ‘exporttracker$AplIbuTrackerRequirement’ is unknown.

Kindly guide me to resolve the same.

Thanks in advance.

Regards,
Velankanni J

It means that there is no AplIbuTrackerConfirmation.id.month attribute in your data model.

Hi,

Yes Thanks for your reply.

I have more than one data store and I have not mentioned on which data store this query should run. Hence it has taken the default data store and given the above error.

Have given the proper data store and it is working fine.

Regards,
Velankanni J