test.tester.model.dao
Class DownloadBroker

java.lang.Object
  |
  +--test.tester.model.dao.DownloadBroker

public class DownloadBroker
extends java.lang.Object

For selecting some rows, you can create a method inside here, or use any of the ones that are already dones (most common ones).

Some methods return a single Download, like selectById(Integer).

Here is one example for getting ALL rows from the DOWNLOAD table:

     // as you can see, it is a static method
     // you can use here any of the select*(...) methods
     Collection result = DownloadBroker.selectAll();
     Iterator iterator = result.iterator();

     while (iterator.hasNext()) {
         Download download = (Download) iterator.next();
         System.out.println(download.toString());
     }
     
 

See Also:
Download

Constructor Summary
DownloadBroker()
           
 
Method Summary
static int count()
          Gets how many rows has this table.
static void deleteByDownloadId(java.lang.Integer downloadId)
          Deletes a Download with a given a DownloadId.
static void insert(Download download)
          Inserts a new Download in the database.
static java.util.Collection selectAll()
          Select all rows from the DOWNLOAD, and then returns each row as one instance of Download, all of them inside a Collection.
static java.util.Collection selectByBody(java.io.ByteArrayInputStream body)
          Select all rows from the DOWNLOAD table, given a body.
static java.util.Collection selectByCategoryId(java.lang.Integer categoryId)
          Select all rows from the DOWNLOAD table, given a categoryId.
static java.util.Collection selectByDay(java.lang.String day)
          Select all rows from the DOWNLOAD table, given a day.
static Download selectByDownloadId(java.lang.Integer downloadId)
          Select a row from the DOWNLOAD table, given a downloadId.
static java.util.Collection selectBySubtitle(java.lang.String subtitle)
          Select all rows from the DOWNLOAD table, given a subtitle.
static java.util.Collection selectByTitle(java.lang.String title)
          Select all rows from the DOWNLOAD table, given a title.
static void updateByDownloadId(Download download)
          Updates a Download, using its primary key DownloadId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DownloadBroker

public DownloadBroker()
Method Detail

selectAll

public static java.util.Collection selectAll()
                                      throws DAOException
Select all rows from the DOWNLOAD, and then returns each row as one instance of Download, all of them inside a Collection. It never returns null, maybe a empty Collection.

DAOException

count

public static int count()
                 throws DAOException
Gets how many rows has this table.

DAOException

insert

public static void insert(Download download)
                   throws DAOException
Inserts a new Download in the database.

DAOException

deleteByDownloadId

public static void deleteByDownloadId(java.lang.Integer downloadId)
                               throws DAOException
Deletes a Download with a given a DownloadId.

DAOException

updateByDownloadId

public static void updateByDownloadId(Download download)
                               throws DAOException
Updates a Download, using its primary key DownloadId.

DAOException

selectByDownloadId

public static Download selectByDownloadId(java.lang.Integer downloadId)
                                   throws DAOException
Select a row from the DOWNLOAD table, given a downloadId. As downloadId is a primary key, there is no need to return a Collection.
This method can return null, if no row matches.

DAOException

selectByTitle

public static java.util.Collection selectByTitle(java.lang.String title)
                                          throws DAOException
Select all rows from the DOWNLOAD table, given a title. Then returns each row as one instance of Download, all of them inside a Collection. It never returns null, maybe an empty Collection.

DAOException

selectBySubtitle

public static java.util.Collection selectBySubtitle(java.lang.String subtitle)
                                             throws DAOException
Select all rows from the DOWNLOAD table, given a subtitle. Then returns each row as one instance of Download, all of them inside a Collection. It never returns null, maybe an empty Collection.

DAOException

selectByBody

public static java.util.Collection selectByBody(java.io.ByteArrayInputStream body)
                                         throws DAOException
Select all rows from the DOWNLOAD table, given a body. Then returns each row as one instance of Download, all of them inside a Collection. It never returns null, maybe an empty Collection.

DAOException

selectByDay

public static java.util.Collection selectByDay(java.lang.String day)
                                        throws DAOException
Select all rows from the DOWNLOAD table, given a day. Then returns each row as one instance of Download, all of them inside a Collection. It never returns null, maybe an empty Collection.

DAOException

selectByCategoryId

public static java.util.Collection selectByCategoryId(java.lang.Integer categoryId)
                                               throws DAOException
Select all rows from the DOWNLOAD table, given a categoryId. Then returns each row as one instance of Download, all of them inside a Collection. It never returns null, maybe an empty Collection.

DAOException