public final <K> int count(Class<? extends RawEntity<K>> type, String criteria, Object... parameters) { try { return entityManager.count(type, criteria, parameters); } catch (SQLException e) { throw new ActiveObjectsSqlException(entityManager, e); } }
/** * Counts all entities of the specified type. This method is actually a delegate for: <code>count(Class<? * extends Entity>, Query)</code> * * @param type The type of the entities which should be counted. * @return The number of entities of the specified type. */ public <K> int count(Class<? extends RawEntity<K>> type) throws SQLException { return count(type, Query.select()); }
public final <K> int count(Class<? extends RawEntity<K>> type) { try { return entityManager.count(type); } catch (SQLException e) { throw new ActiveObjectsSqlException(entityManager, e); } }
/** * Counts all entities of the specified type. This method is actually a delegate for: <code>count(Class<? * extends Entity>, Query)</code> * * @param type The type of the entities which should be counted. * @return The number of entities of the specified type. */ public <K> int count(Class<? extends RawEntity<K>> type) throws SQLException { return count(type, Query.select()); }
public final <K> int count(Class<? extends RawEntity<K>> type, Query query) { try { return entityManager.count(type, query); } catch (SQLException e) { throw new ActiveObjectsSqlException(entityManager, e); } }
/** * Counts all entities of the specified type matching the given criteria and parameters. This is a convenience * method for: <code>count(type, Query.select().where(criteria, parameters))</code> * * @param type The type of the entities which should be counted. * @param criteria A parameterized WHERE statement used to determine the result set which will be counted. * @param parameters A varargs array of parameters to be passed to the executed prepared statement. The length of * this array <i>must</i> match the number of parameters (denoted by the '?' char) in the <code>criteria</code>. * @return The number of entities of the given type which match the specified criteria. */ public <K> int count(Class<? extends RawEntity<K>> type, String criteria, Object... parameters) throws SQLException { return count(type, Query.select().where(criteria, parameters)); }
/** * Counts all entities of the specified type matching the given criteria and parameters. This is a convenience * method for: <code>count(type, Query.select().where(criteria, parameters))</code> * * @param type The type of the entities which should be counted. * @param criteria A parameterized WHERE statement used to determine the result set which will be counted. * @param parameters A varargs array of parameters to be passed to the executed prepared statement. The length of * this array <i>must</i> match the number of parameters (denoted by the '?' char) in the <code>criteria</code>. * @return The number of entities of the given type which match the specified criteria. */ public <K> int count(Class<? extends RawEntity<K>> type, String criteria, Object... parameters) throws SQLException { return count(type, Query.select().where(criteria, parameters)); }