Hi again,
I take note of this behaviour as normal, I thought I was doing something
wrong when I got the value of fields not explicity added to the Query.
One more question still not solved:
// Create the query to retrieve info from the CMS repository
Query query = cloud.createQuery();
// Define the object types involved in the query
NodeManager type1 = cloud.getNodeManager("url");
NodeManager type2 = cloud.getNodeManager("tema");
// Create the query steps
query.addStep(type1);
query.addRelationStep(type2);
// Add the desired fields
StepField campo_number = query.addField("url.number");
query.addField("url.nombre");
query.addField("url.url");
query.addField("tema.descripcion");
// Establish the sort order
query.addSortOrder(campo_number, SortOrder.ORDER_DESCENDING);
// We set the max number of items to retrieve
query.setMaxNumber(itemsToShow);
// Launch the query against the cloud
List elementList = cloud.getList(query);
The Query interface uses the addStep() and addRelationStep() methods but
only shows clusternodes for type1&type2 records, this is, what it seems to
do is a inner join of type1 and type2 fields, this way I only get the info
for type1 records that are related to type2 ones.
Wha I need to obtain is somewhat like a "left join": I get a List of
ClusterNodes that have the desired fields of each type1 instance and (if
exist) their corresponding values in type2, getting NULL for that fields if
no type2 record is related to that type1 instance.
Is there a way to get it? I've tried the ALL/EITHER/BOTH/SOURCE/DESTINATION
values in addRelationStep(NodeManager nodeManager, java.lang.String role,
java.lang.String searchDir) with no luck.
Thanks in advance,
Ignacio.-