Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.torque.util
Class CountHelper

    java.lang.Object
      org.apache.torque.util.CountHelper

    public class CountHelper

extends Object

Counts entries matching a criteria.

Constructor Summary
`CountHelper()`

Method Summary
`int` | `count(Criteria c)` Deprecated. use org.apache.torque.criteria.Criteria instead of org.apache.torque.util.Criteria. This method will be removed in Torque 4.1.
`int` | `count(Criteria c)` The COUNT function returns the number of rows in a query.
`int` | `count(Criteria c, Column column)` Deprecated. use org.apache.toraue.criteria.Criteria instead of org.apache.toraue.util.Criteria. This method will be removed in Torque 4.1.
`int` | `count(Criteria c, Column column)` Returns the number of rows in a query.
`int` | `count(Criteria c, Connection conn)` Deprecated. use org.apache.toraue.criteria.Criteria instead of org.apache.toraue.util.Criteria. This method will be removed in Torque 4.1.
`int` | `count(Criteria c, Connection conn)` The COUNT function returns the number of rows in a query.
`int` | `count(Criteria c, Connection conn, Column column)` Deprecated. use org.apache.toraue.criteria.Criteria instead of org.apache.toraue.util.Criteria. This method will be removed in Torque 4.1.
`int` | `count(Criteria c, Connection conn, Column column)` Returns the number of rows in a query.
`int` | `count(Criteria c, Connection conn, String columnName, TableMap tableMap)` Deprecated. use org.apache.toraue.criteria.Criteria instead of org.apache.toraue.util.Criteria. This method will be removed in Torque 4.1.
`int` | `count(Criteria c, Connection conn, String columnName, TableMap tableMap)` Returns the number of rows in a query.
`int` | `count(Criteria c, String columnName)` Deprecated. use org.apache.toraue.criteria.Criteria instead of org.apache.toraue.util.Criteria. This method will be removed in Torque 4.1.
`int` | `count(Criteria c, String columnName)` Returns the number of rows in a query.
`int` | `count(TableMap tableMap)` Counts all rows in a table.
`int` | `count(TableMap tableMap, Connection conn)` Counts all rows in a table.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CountHelper

    public CountHelper()

Method Detail

### count

    @Deprecated
    public int count(Criteria c)
              throws TorqueException

  Deprecated. use org.apache.torque.criteria.Criteria instead of org.apache.torque.util.Criteria. This method will be removed in Torque 4.1.

  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.

  Parameters:
    `c` - Criteria to get the count for.
  Returns:
    number of rows matching the query provided
  Throws:
    `TorqueException` - if the query could not be executed

### count

    public int count(Criteria c)
              throws TorqueException

  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.

  Parameters:
    `c` - Criteria to get the count for.
  Returns:
    number of rows matching the query provided
  Throws:
    `TorqueException` - if the query could not be executed

### count

    @Deprecated
    public int count(Criteria c,
                                Connection conn)
              throws TorqueException

  Deprecated. use org.apache.toraue.criteria.Criteria instead of org.apache.toraue.util.Criteria. This method will be removed in Torque 4.1.

  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.

  Parameters:
    `c` - Criteria to get the count for.
    `conn` - Connection to use
  Returns:
    number of rows matching the query provided
  Throws:
    `TorqueException` - if the query could not be executed

### count

    public int count(Criteria c,
                     Connection conn)
              throws TorqueException

  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.

  Parameters:
    `c` - Criteria to get the count for.
    `conn` - Connection to use
  Returns:
    number of rows matching the query provided
  Throws:
    `TorqueException` - if the query could not be executed

### count

    @Deprecated
    public int count(Criteria c,
                                String columnName)
              throws TorqueException

  Deprecated. use org.apache.toraue.criteria.Criteria instead of org.apache.toraue.util.Criteria. This method will be removed in Torque 4.1.

  Returns the number of rows in a query.

  Parameters:
    `c` - Criteria to get the count for.
    `columnName` - Name of database Column which is counted. Preferably, use the primary key here.
  Returns:
    number of rows matching the query provided
  Throws:
    `TorqueException` - if the query could not be executed

### count

    public int count(Criteria c,
                     String columnName)
              throws TorqueException

  Returns the number of rows in a query.

  Parameters:
    `c` - Criteria to get the count for.
    `columnName` - Name of database Column which is counted. Preferably, use the primary key here.
  Returns:
    number of rows matching the query provided
  Throws:
    `TorqueException` - if the query could not be executed

### count

    @Deprecated
    public int count(Criteria c,
                                Column column)
              throws TorqueException

  Deprecated. use org.apache.toraue.criteria.Criteria instead of org.apache.toraue.util.Criteria. This method will be removed in Torque 4.1.

  Returns the number of rows in a query.

  Parameters:
    `c` - Criteria to get the count for.
    `column` - the database Column which is counted. Preferably, use the primary key here.
  Returns:
    number of rows matching the query provided
  Throws:
    `TorqueException` - if the query could not be executed

### count

    public int count(Criteria c,
                     Column column)
              throws TorqueException

  Returns the number of rows in a query.

  Parameters:
    `c` - Criteria to get the count for.
    `column` - the database Column which is counted. Preferably, use the primary key here.
  Returns:
    number of rows matching the query provided
  Throws:
    `TorqueException` - if the query could not be executed

### count

    @Deprecated
    public int count(Criteria c,
                                Connection conn,
                                Column column)
              throws TorqueException

  Deprecated. use org.apache.toraue.criteria.Criteria instead of org.apache.toraue.util.Criteria. This method will be removed in Torque 4.1.

  Returns the number of rows in a query.

  Parameters:
    `c` - Criteria to get the count for.
    `conn` - Connection to use
    `column` - The database Column which is counted. Preferably, use the primary key here.
  Returns:
    number of rows matching the query provided
  Throws:
    `TorqueException` - if the query could not be executed

### count

    public int count(Criteria c,
                     Connection conn,
                     Column column)
              throws TorqueException

  Returns the number of rows in a query.

  Parameters:
    `c` - Criteria to get the count for.
    `conn` - Connection to use
    `column` - The database Column which is counted. Preferably, use the primary key here.
  Returns:
    number of rows matching the query provided
  Throws:
    `TorqueException` - if the query could not be executed

### count

    public int count(TableMap tableMap)
              throws TorqueException

  Counts all rows in a table.

  Parameters:
    `tableMap` - the table map of the table to count rows in.
  Returns:
    the number of rows in the table.
  Throws:
    `TorqueException` - if the query could not be executed

### count

    public int count(TableMap tableMap,
                     Connection conn)
              throws TorqueException

  Counts all rows in a table.

  Parameters:
    `tableMap` - the table map of the table to count rows in.
    `conn` - the connection to use.
  Returns:
    the number of rows in the table.
  Throws:
    `TorqueException` - if the query could not be executed

### count

    @Deprecated
    public int count(Criteria c,
                                Connection conn,
                                String columnName,
                                TableMap tableMap)
              throws TorqueException

  Deprecated. use org.apache.toraue.criteria.Criteria instead of org.apache.toraue.util.Criteria. This method will be removed in Torque 4.1.

  Returns the number of rows in a query.

  Parameters:
    `c` - Criteria to get the count for.
    `conn` - Connection to use
    `columnName` - 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.
  Returns:
    number of rows matching the query provided.
  Throws:
    `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.

  Parameters:
    `c` - Criteria to get the count for.
    `conn` - Connection to use
    `columnName` - 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.
  Returns:
    number of rows matching the query provided.
  Throws:
    `TorqueException` - if the query could not be executed.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2013 The Apache Software Foundation. All Rights Reserved.