public XExecution getXExecution(String query, String db, List<MapType> queryConfig, List<MapType> sessionConfig){ XExecution execution = new XExecution(); XJobQuery xJobQuery = new XJobQuery(); xJobQuery.setQuery(query); if (queryConfig != null){ xJobQuery.withConf(queryConfig); } XSessionType sessionType = new XSessionType(); if (db == null){ db = getCurrentDB(); } sessionType.setDb(db); if (sessionConfig != null){ sessionType.withConf(sessionConfig); } execution.setQuery(xJobQuery); execution.setSession(sessionType); return execution; }