View not work for additional datastore Entity

Hi team,

My platform version is 7.2.5

here’s my code:
View deviceView =ViewBuilder.of(Device.class).add(“name”).build();
List deviceList = dataManager.load(Device.class).view(deviceView).list();

The “Device” entity is defined in an additional datastore.
The result contains data for all fields. Seems the view doesn’t work at all.

Please kindly advise how to use View for additional datastore.

thank you

Hi.
I’ve tried your case using platform 7.2.6 and everything works fine for me.
I’ve created Device Entity with three attributes: name, number and date, and use your code:

View deviceView = ViewBuilder.of(Device.class).add("name").build();
List<Device> deviceList = dataManager.load(Device.class).view(deviceView).list();

As you can see only name attribute was loaded.
image

Could you provide more information about your problem? How did you know that the result contains data for all fields?

Regards,
Natalia

Hi Natalia,

I checked my result in the same way. I can see other fileds not defined by view also loaded with data.

Just to double confirm, your entity is in an additional datastore, right?

Hi,
I’ve got some projects with entities located in additional data stores and I didn’t find the problem that you commented.
Regards.