Re: How to join two dynamic views?

2024-02-05 Thread Tomek

Thanks

On 1.02.2024 19:44, Rishi Solanki wrote:

Dear Tomek,
To create the view link between two tables its definition and fields should
be loaded. So instead of linking two dynamic view make static view using
entitymodel.xml file and link them.

Rishi Solanki
*CTO, Mindpath Technology*
Intelligent Solutions
cell: +91-98932-87847
LinkedIn 


On Thu, Jan 25, 2024 at 8:39 PM Tomek  wrote:


Hi,

I would like to create two dynamic views and link with together. It is
possible? I try like this:

// Currently the following view can be replaced by entity
// but I assume that it will be more complex.
final DynamicViewEntity productFacilityView = new DynamicViewEntity();
productFacilityView.addMemberEntity("PF", "ProductFacility");
productFacilityView.addAliasAll("PF", "", new LinkedList<>());

final DynamicViewEntity view = new DynamicViewEntity();
view.addMemberEntity("PRD", "Product");
view.addMemberEntity("PF", productFacilityView.getEntityName());
view.addAliasAll("PRD", "", new LinkedList<>());

final ModelKeyMap modelKeyMap = new ModelKeyMap("productId", "productId");
final List maps = new LinkedList<>();
maps.add(modelKeyMap);
view.addViewLink("PRD", "PF", false, maps);
final List list =
EntityQuery.use(delegator).from(view).queryList();

But it does not work.

Tomek




Re: How to join two dynamic views?

2024-02-01 Thread Rishi Solanki
Dear Tomek,
To create the view link between two tables its definition and fields should
be loaded. So instead of linking two dynamic view make static view using
entitymodel.xml file and link them.

Rishi Solanki
*CTO, Mindpath Technology*
Intelligent Solutions
cell: +91-98932-87847
LinkedIn 


On Thu, Jan 25, 2024 at 8:39 PM Tomek  wrote:

> Hi,
>
> I would like to create two dynamic views and link with together. It is
> possible? I try like this:
>
> // Currently the following view can be replaced by entity
> // but I assume that it will be more complex.
> final DynamicViewEntity productFacilityView = new DynamicViewEntity();
> productFacilityView.addMemberEntity("PF", "ProductFacility");
> productFacilityView.addAliasAll("PF", "", new LinkedList<>());
>
> final DynamicViewEntity view = new DynamicViewEntity();
> view.addMemberEntity("PRD", "Product");
> view.addMemberEntity("PF", productFacilityView.getEntityName());
> view.addAliasAll("PRD", "", new LinkedList<>());
>
> final ModelKeyMap modelKeyMap = new ModelKeyMap("productId", "productId");
> final List maps = new LinkedList<>();
> maps.add(modelKeyMap);
> view.addViewLink("PRD", "PF", false, maps);
> final List list =
> EntityQuery.use(delegator).from(view).queryList();
>
> But it does not work.
>
> Tomek
>
>