Package org.apache.torque.util
Klasse AvgHelper
java.lang.Object
org.apache.torque.util.AvgHelper
Get's the average of a column with entries matching the provided criteria.
This works similarly to the CountHelper when you need to provide
additional selection criteria to compute an average.
For example, limiting the average of a column in a table to a specific user.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungReturns the average of a column in a query.avg
(Criteria c, Connection conn, String columnName, TableMap tableMap) Returns the average of a column in a query.avg
(Criteria c, Connection conn, Column column) Returns the average of a column in a query.Returns the average of a column in a query.
-
Konstruktordetails
-
AvgHelper
public AvgHelper()
-
-
Methodendetails
-
avg
Returns the average of a column 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:
- average of the column matching the query provided
- Löst aus:
TorqueException
- if the query could not be executed
-
avg
Returns the average of a column in a query.- Parameter:
c
- Criteria to get the count for.column
- Name of database Column which is averaged.- Gibt zurück:
- average of the column matching the query provided
- Löst aus:
TorqueException
- if the query could not be executed
-
avg
Returns the average of a column in a query.- Parameter:
c
- Criteria to get the count for.conn
- Connection to usecolumn
- Name of database Column which is averaged.- Gibt zurück:
- average of the column matching the query provided
- Löst aus:
TorqueException
- if the query could not be executed
-
avg
public BigDecimal avg(Criteria c, Connection conn, String columnName, TableMap tableMap) throws TorqueException Returns the average of a column in a query.- Parameter:
c
- Criteria to get the count for.conn
- Connection to usecolumnName
- Name of database Column which is averaged.tableMap
- the table to count the columns in, or null to determine the table automatically from the criteria.- Gibt zurück:
- average of the column matching the query provided
- Löst aus:
TorqueException
- if the query could not be executed.
-