test.tester.model.dao
Class LinkBroker

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

public class LinkBroker
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 Link, like selectById(Integer).

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

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

     while (iterator.hasNext()) {
         Link link = (Link) iterator.next();
         System.out.println(link.toString());
     }
     
 

See Also:
Link

Constructor Summary
LinkBroker()
           
 
Method Summary
static int count()
          Gets how many rows has this table.
static void deleteByLinkId(java.lang.Integer linkId)
          Deletes a Link with a given a LinkId.
static void insert(Link link)
          Inserts a new Link in the database.
static java.util.Collection selectAll()
          Select all rows from the LINK, and then returns each row as one instance of Link, all of them inside a Collection.
static java.util.Collection selectByCategoryId(java.lang.Integer categoryId)
          Select all rows from the LINK table, given a categoryId.
static java.util.Collection selectByLink(java.lang.String link)
          Select all rows from the LINK table, given a link.
static Link selectByLinkId(java.lang.Integer linkId)
          Select a row from the LINK table, given a linkId.
static java.util.Collection selectBySubtitle(java.lang.String subtitle)
          Select all rows from the LINK table, given a subtitle.
static java.util.Collection selectByTitle(java.lang.String title)
          Select all rows from the LINK table, given a title.
static void updateByLinkId(Link link)
          Updates a Link, using its primary key LinkId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkBroker

public LinkBroker()
Method Detail

selectAll

public static java.util.Collection selectAll()
                                      throws DAOException
Select all rows from the LINK, and then returns each row as one instance of Link, 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(Link link)
                   throws DAOException
Inserts a new Link in the database.

DAOException

deleteByLinkId

public static void deleteByLinkId(java.lang.Integer linkId)
                           throws DAOException
Deletes a Link with a given a LinkId.

DAOException

updateByLinkId

public static void updateByLinkId(Link link)
                           throws DAOException
Updates a Link, using its primary key LinkId.

DAOException

selectByLinkId

public static Link selectByLinkId(java.lang.Integer linkId)
                           throws DAOException
Select a row from the LINK table, given a linkId. As linkId 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 LINK table, given a title. Then returns each row as one instance of Link, 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 LINK table, given a subtitle. Then returns each row as one instance of Link, all of them inside a Collection. It never returns null, maybe an empty Collection.

DAOException

selectByLink

public static java.util.Collection selectByLink(java.lang.String link)
                                         throws DAOException
Select all rows from the LINK table, given a link. Then returns each row as one instance of Link, 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 LINK table, given a categoryId. Then returns each row as one instance of Link, all of them inside a Collection. It never returns null, maybe an empty Collection.

DAOException