// Path: src/main/java/xdb/control/Query.java
// public interface Query {
// 
//     /**
//      * Execute the query.
//      * 
//      * @param doc
//      *            The document being queried.
//      * @param params
//      *            Query parameters.
//      * @return The list of nodes in the results.
//      * @throws xdb.control.QueryException
//      *             For errors.
//      */
//     public List<Node> query(Document doc, Map<String, String[]> params) throws QueryException;
// }
// 
// Path: src/main/java/xdb/control/QueryException.java
// @SuppressWarnings("serial")
// public class QueryException extends Exception {
// 
//     /**
//      * Constructor.
//      * 
//      * @param message
//      *            The error message.
//      * @param rootCause
//      *            The true cause of the exception.
//      */
//     public QueryException(String message, Exception rootCause) {
//         super(message, rootCause);
//     }
// }


import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import xdb.control.Query;
import xdb.control.QueryException;
package xdb.query;



/**
 * An optimized query processor to retrieve entity elements using their ids. This query accepts
 * multiple "id" parameters and returns the list of nodes matching those ids.
 */
public class MultiIdQuery implements Query {
    private final String entityType;

    /**
     * Init the query from its configuration.
     * 
     * @param configElement
     *            The configuration element.
     * @return The query.
     */
    public static MultiIdQuery init(Element configElement) {
        String entityType = configElement.getAttribute("entity-type");
        return new MultiIdQuery(entityType);
    }

    /**
     * Constructor.
     * 
     * @param entityType
     *            The entity type to be retrieve, null for any entity.
     */
    public MultiIdQuery(String entityType) {
        this.entityType = entityType;
    }

    @Override
// Path: src/main/java/xdb/control/Query.java
// public interface Query {
// 
//     /**
//      * Execute the query.
//      * 
//      * @param doc
//      *            The document being queried.
//      * @param params
//      *            Query parameters.
//      * @return The list of nodes in the results.
//      * @throws xdb.control.QueryException
//      *             For errors.
//      */
//     public List<Node> query(Document doc, Map<String, String[]> params) throws QueryException;
// }
// 
// Path: src/main/java/xdb/control/QueryException.java
// @SuppressWarnings("serial")
// public class QueryException extends Exception {
// 
//     /**
//      * Constructor.
//      * 
//      * @param message
//      *            The error message.
//      * @param rootCause
//      *            The true cause of the exception.
//      */
//     public QueryException(String message, Exception rootCause) {
//         super(message, rootCause);
//     }
// }


// Path: src/main/java/xdb/query/MultiIdQuery.java
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import xdb.control.Query;
import xdb.control.QueryException;

package xdb.query;



/**
 * An optimized query processor to retrieve entity elements using their ids. This query accepts
 * multiple "id" parameters and returns the list of nodes matching those ids.
 */
public class MultiIdQuery implements Query {
    private final String entityType;

    /**
     * Init the query from its configuration.
     * 
     * @param configElement
     *            The configuration element.
     * @return The query.
     */
    public static MultiIdQuery init(Element configElement) {
        String entityType = configElement.getAttribute("entity-type");
        return new MultiIdQuery(entityType);
    }

    /**
     * Constructor.
     * 
     * @param entityType
     *            The entity type to be retrieve, null for any entity.
     */
    public MultiIdQuery(String entityType) {
        this.entityType = entityType;
    }

    @Override
    public List<Node> query(Document doc, Map<String, String[]> params) throws QueryException {