Package org.apache.torque.util
Klasse CountHelper
java.lang.Object
org.apache.torque.util.CountHelper
Counts entries matching a criteria.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungint
The COUNT function returns the number of rows in a query.int
Returns the number of rows in a query.int
count
(Criteria c, Connection conn) The COUNT function returns the number of rows in a query.int
count
(Criteria c, Connection conn, String columnName, TableMap tableMap) Returns the number of rows in a query.int
count
(Criteria c, Connection conn, Column column) Returns the number of rows in a query.int
Returns the number of rows in a query.int
Counts all rows in a table.int
count
(TableMap tableMap, Connection conn) Counts all rows in a table.
-
Konstruktordetails
-
CountHelper
public CountHelper()
-
-
Methodendetails
-
count
The COUNT function returns the number of rows in a query. Does not use a connection, hardcode the column to "*" and set the distinct qualifier to false. Only use this function if you have added additional constraints to the criteria, otherwise Torque does not know which table it should count the datasets in.- Parameter:
c
- Criteria to get the count for.- Gibt zurück:
- number of rows matching the query provided
- Löst aus:
TorqueException
- if the query could not be executed
-
count
The COUNT function returns the number of rows in a query. Hard code the distinct parameter to false and set the column to "*". Only use this function if you have added additional constraints to the criteria, otherwise Torque does not know which table it should count the datasets in.- Parameter:
c
- Criteria to get the count for.conn
- Connection to use- Gibt zurück:
- number of rows matching the query provided
- Löst aus:
TorqueException
- if the query could not be executed
-
count
Returns the number of rows in a query.- Parameter:
c
- Criteria to get the count for.columnName
- Name of database Column which is counted. Preferably, use the primary key here.- Gibt zurück:
- number of rows matching the query provided
- Löst aus:
TorqueException
- if the query could not be executed
-
count
Returns the number of rows in a query.- Parameter:
c
- Criteria to get the count for.column
- the database Column which is counted. Preferably, use the primary key here.- Gibt zurück:
- number of rows matching the query provided
- Löst aus:
TorqueException
- if the query could not be executed
-
count
Returns the number of rows in a query.- Parameter:
c
- Criteria to get the count for.conn
- Connection to usecolumn
- The database Column which is counted. Preferably, use the primary key here.- Gibt zurück:
- number of rows matching the query provided
- Löst aus:
TorqueException
- if the query could not be executed
-
count
Counts all rows in a table.- Parameter:
tableMap
- the table map of the table to count rows in.- Gibt zurück:
- the number of rows in the table.
- Löst aus:
TorqueException
- if the query could not be executed
-
count
Counts all rows in a table.- Parameter:
tableMap
- the table map of the table to count rows in.conn
- the connection to use.- Gibt zurück:
- the number of rows in the table.
- Löst aus:
TorqueException
- if the query could not be executed
-
count
public int count(Criteria c, Connection conn, String columnName, TableMap tableMap) throws TorqueException Returns the number of rows in a query.- Parameter:
c
- Criteria to get the count for.conn
- Connection to usecolumnName
- Name of database Column which is counted. Preferably, use the primary key here.tableMap
- the table to count the columns in, or null to determine the table automatically from the criteria.- Gibt zurück:
- number of rows matching the query provided.
- Löst aus:
TorqueException
- if the query could not be executed.
-