public SqlEntityTable(SqlCollectionStore store, Query query, Connection conn) { this.store = store; this.query = query; this.mysqlQuery = store.newSqlQuery(query); this.dataConn = conn; }
@Override public IEntity getEntity(ORI collectionURI) { collectionURI = collectionURI.toAbsolute(query.getOn()); Collection collection = store.getCollection(collectionURI); SqlEntity entity = new SqlEntity(collection); store .getSqlDialect() .loadEntity( query, store.getDDL(collectionURI), dataRS, entity, QueryUtils.newCollectionAlias(query, collectionURI)); return entity; }
private void initDataRS() { String sql = null; try { dataSt = store.createReadStatement(dataConn); sql = mysqlQuery.toSelectSQL(); LOGGER.debug(sql); dataRS = dataSt.executeQuery(sql); } catch (Exception e) { try { // Give a second change (Broken pipe exception) dataSt = store.createReadStatement(dataConn); sql = mysqlQuery.toSelectSQL(); dataRS = dataSt.executeQuery(sql); } catch (Exception e2) { throw new RuntimeException(e2); } } }