jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Müller <Kevin.Muel...@cib.de>
Subject Bulk load of several nodes
Date Fri, 13 Jan 2012 10:00:50 GMT
Hi,

I think in some cases it would be useful to get all or some properties of a set of nodes in
one database query.
Can somebody tell me if something like this is planned for future releases ?

One example for this usecase would be:
for (RowIterator it = qm.createQuery("//*[@prop='some_value']/(@prop2|@prop3)", Query.XPATH).execute().getRows();
it.hasNext(); ) {
        Row row = it.nextRow();
        Map map = new HashMap();
        for (String key : Arrays.asList("prop2", "prop3")) {
                Value val = row.getValue(key);
                map.put(key, val != null ? val.getString() : null);
        }
        res.put(row.getPath(), map);
}

Wouldn't be nice if this could be done with one database roundtrip - right now (2.2.10) there
are at least n roundtrips (n == number of results in query) it seems to me.

Regards,
Kevin Müller


Mime
View raw message