Skip to main content
1-Visitor
March 30, 2016
Question

How to bulk retrieve attribute values

  • March 30, 2016
  • 1 reply
  • 1466 views

Hello!

Anyone who knows to to bulk retrieve attribute values?

To bulk load lots of attribute values from a single persistable you would normally write something like below:

PersistableAdapter pa = new PersistableAdapter(p,null,Locale.US,null);

pa.load(attributeNames);

for(String attributeName : attributeNames){

  String attributeValue = (String) pa.get(attributeName);

}

However this only allows me to fetch attribute values for a single persistable at a time.

I'm looking at a way to extend the code to bulk load a collection of persistables instead.

Does anyone know if this is possible?

Doing this by querying the database is quite easy but I would much rather use an existing API.

Thanks and best regards,

Peter

1 reply

16-Pearl
April 4, 2016

I don't think PersistableAdapter has any constructor to take collection of objects. You can either write a QuerySpec to fetch all object and loop one by one to get the required attributes Or try using Info*Engine Webject to query objects with attributes.

Regards,

Bhushan