/** * {@inheritDoc} * * Delegates to the parent ObjectStore */ @Override protected String generateSql(Connection c, Query q, int start, int limit) throws ObjectStoreException { return os.generateSql(c, q, start, limit); }
/** * {@inheritDoc} * * Delegates to the parent ObjectStore */ @Override protected String generateSql(Connection c, Query q, int start, int limit) throws ObjectStoreException { return os.generateSql(c, q, start, limit); }
/** * Get the SQl that will be run on the database. * @param pathQuery The path-query to run. * @return An SQL command. * @throws ObjectStoreException If something goes wrong. */ public String makeSql(PathQuery pathQuery) throws ObjectStoreException { Query query = makeQuery(pathQuery); ObjectStoreInterMineImpl osimi = (ObjectStoreInterMineImpl) os; return osimi.generateSql(query); }
/** * Creates an SQL query from a PathQuery. * * @param pathQuery the query to convert * @return an SQL String * @throws ObjectStoreException if problem creating query */ public String makeSql(PathQuery pathQuery) throws ObjectStoreException { Query query = makeQuery(pathQuery); ObjectStoreInterMineImpl osimi = (ObjectStoreInterMineImpl) os; return osimi.generateSql(query); }
/** * Get the SQl that will be run on the database. * @param pathQuery The path-query to run. * @return An SQL command. * @throws ObjectStoreException If something goes wrong. */ public String makeSql(PathQuery pathQuery) throws ObjectStoreException { Query query = makeQuery(pathQuery); ObjectStoreInterMineImpl osimi = (ObjectStoreInterMineImpl) os; return osimi.generateSql(query); }
/** * Creates an SQL query from a PathQuery. * * @param pathQuery the query to convert * @return an SQL String * @throws ObjectStoreException if problem creating query */ public String makeSql(PathQuery pathQuery) throws ObjectStoreException { Query query = makeQuery(pathQuery); ObjectStoreInterMineImpl osimi = (ObjectStoreInterMineImpl) os; return osimi.generateSql(query); }
/** * Checks if a query is precomputed or not for the given type and connection * * @param c the connection * @param query the query * @param type the type * @return true if and only if the given query is (already) precomputed * @throws ObjectStoreException if there is a database problem * @throws SQLException if there is a database problem */ public boolean isPrecomputedWithConnection(Connection c, Query query, String type) throws ObjectStoreException, SQLException { PrecomputedTableManager ptm = PrecomputedTableManager.getInstance(db); String sqlQuery = generateSql(c, query, 0, Integer.MAX_VALUE); return (ptm.lookupSql(type, sqlQuery) != null); }
/** * Checks if a query is precomputed or not for the given type and connection * * @param c the connection * @param query the query * @param type the type * @return true if and only if the given query is (already) precomputed * @throws ObjectStoreException if there is a database problem * @throws SQLException if there is a database problem */ public boolean isPrecomputedWithConnection(Connection c, Query query, String type) throws ObjectStoreException, SQLException { PrecomputedTableManager ptm = PrecomputedTableManager.getInstance(db); String sqlQuery = generateSql(c, query, 0, Integer.MAX_VALUE); return (ptm.lookupSql(type, sqlQuery) != null); }
/** * Generate sql from a Query * * @param q the Query * @return an SQL String * @throws ObjectStoreException if something goes wrong */ public String generateSql(Query q) throws ObjectStoreException { Connection c = null; try { c = getConnection(); return generateSql(c, q, 0, Integer.MAX_VALUE); } catch (SQLException e) { throw new ObjectStoreException("Failed to get connection", e); } finally { releaseConnection(c); } }
/** * Generate sql from a Query * * @param q the Query * @return an SQL String * @throws ObjectStoreException if something goes wrong */ public String generateSql(Query q) throws ObjectStoreException { Connection c = null; try { c = getConnection(); return generateSql(c, q, 0, Integer.MAX_VALUE); } catch (SQLException e) { throw new ObjectStoreException("Failed to get connection", e); } finally { releaseConnection(c); } }
String sql; try { sql = generateSql(c, q, 0, Integer.MAX_VALUE); } catch (CompletelyFalseException e) { return new ResultsInfo(0, 0, 0, 0, 0);
String sql; try { sql = generateSql(c, q, 0, Integer.MAX_VALUE); } catch (CompletelyFalseException e) { return new ResultsInfo(0, 0, 0, 0, 0);