/** * Returns the long value of the first field selected given a query. If no rows are returned, * will throw SQLException. * <p> * If the value of the first field is null then 0 will be returned in prod, but an assert will * be thrown in test. */ long selectLong(Connection c, String key, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectLongInternal(c, SQLString.getByKey(key, c), vs, null, true); }
/** * Returns the long value of the first field selected given a query. If no rows are returned, * will throw SQLException. * <p> * If the value of the first field is null then 0 will be returned in prod, but an assert will * be thrown in test. */ long selectLongUnregisteredQuery(Connection c, String sql, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectLongInternal(c, SQLString.getUnregisteredQuery(sql), vs, null, true); }
/** * Returns the long value of the first field selected given a query If no rows are returned, * will return defaultVal. * <p> * If the value of the first field is null, then defaultVal will be returned. This means that if * defaultVal is non-null, then this method won't return null. */ Long selectLongWithDefault(Connection c, String key, Long defaultVal, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectLongInternal(c, SQLString.getByKey(key, c), vs, defaultVal, false); }
/** * Returns the long value of the first field selected given a query If no rows are returned, * will return defaultVal. * <p> * If the value of the first field is null, then defaultVal will be returned. This means that if * defaultVal is non-null, then this method won't return null. */ Long selectLongWithDefaultUnregisteredQuery(Connection c, String sql, Long defaultVal, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectLongInternal( c, SQLString.getUnregisteredQuery(sql), vs, defaultVal, false); }
/** * Returns the long value of the first field selected given a query. If no rows are returned, * will throw SQLException. * <p> * If the value of the first field is null then 0 will be returned in prod, but an assert will * be thrown in test. */ long selectLongUnregisteredQuery(Connection c, String sql, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectLongInternal(c, SQLString.getUnregisteredQuery(sql), vs, null, true); }
/** * Returns the long value of the first field selected given a query If no rows are returned, * will return defaultVal. * <p> * If the value of the first field is null, then defaultVal will be returned. This means that if * defaultVal is non-null, then this method won't return null. */ Long selectLongWithDefault(Connection c, String key, Long defaultVal, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectLongInternal(c, SQLString.getByKey(key, c), vs, defaultVal, false); }
/** * Returns the long value of the first field selected given a query. If no rows are returned, * will throw SQLException. * <p> * If the value of the first field is null then 0 will be returned in prod, but an assert will * be thrown in test. */ long selectLong(Connection c, String key, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectLongInternal(c, SQLString.getByKey(key, c), vs, null, true); }
/** * Returns the long value of the first field selected given a query If no rows are returned, * will return defaultVal. * <p> * If the value of the first field is null, then defaultVal will be returned. This means that if * defaultVal is non-null, then this method won't return null. */ Long selectLongWithDefaultUnregisteredQuery(Connection c, String sql, Long defaultVal, Object... vs) throws PalantirSqlException, PalantirInterruptedException { return basicSql.selectLongInternal( c, SQLString.getUnregisteredQuery(sql), vs, defaultVal, false); }