class JcrTemplate extends JcrAccessor implements JcrOperations {

    @Override
    public QueryResult query(final Node node) {

        if (node == null)
            throw new IllegalArgumentException("node can't be null");

        return execute(new JcrCallback<QueryResult>() {
            /**
             * @see JcrCallback#doInJcr(javax.jcr.Session)
             */
            @Override
            public QueryResult doInJcr(Session session) throws RepositoryException {
                boolean debug = LOG.isDebugEnabled();

                // get query manager
                QueryManager manager = session.getWorkspace().getQueryManager();
                if (debug)
                    LOG.debug("retrieved manager " + manager);

                Query query = manager.getQuery(node);
                if (debug)
                    LOG.debug("created query " + query);

                return query.execute();
            }
        }, true);
    }

    public  JcrTemplate();
    public  JcrTemplate(SessionFactory sessionFactory);

}