test.tester.model.dao
Class ArticleBroker

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

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

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

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

     while (iterator.hasNext()) {
         Article article = (Article) iterator.next();
         System.out.println(article.toString());
     }
     
 

See Also:
Article

Constructor Summary
ArticleBroker()
           
 
Method Summary
static int count()
          Gets how many rows has this table.
static void deleteByArticleId(java.lang.Integer articleId)
          Deletes a Article with a given a ArticleId.
static void insert(Article article)
          Inserts a new Article in the database.
static java.util.Collection selectAll()
          Select all rows from the ARTICLE, and then returns each row as one instance of Article, all of them inside a Collection.
static Article selectByArticleId(java.lang.Integer articleId)
          Select a row from the ARTICLE table, given a articleId.
static java.util.Collection selectByBody(java.lang.String body)
          Select all rows from the ARTICLE table, given a body.
static java.util.Collection selectByCategoryId(java.lang.Integer categoryId)
          Select all rows from the ARTICLE table, given a categoryId.
static java.util.Collection selectByDay(java.lang.String day)
          Select all rows from the ARTICLE table, given a day.
static java.util.Collection selectByMemberId(java.lang.Integer memberId)
          Select all rows from the ARTICLE table, given a memberId.
static java.util.Collection selectBySpecial(java.lang.Boolean special)
          Select all rows from the ARTICLE table, given a special.
static java.util.Collection selectBySubtitle(java.lang.String subtitle)
          Select all rows from the ARTICLE table, given a subtitle.
static java.util.Collection selectByTitle(java.lang.String title)
          Select all rows from the ARTICLE table, given a title.
static void updateByArticleId(Article article)
          Updates a Article, using its primary key ArticleId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArticleBroker

public ArticleBroker()
Method Detail

selectAll

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

DAOException

deleteByArticleId

public static void deleteByArticleId(java.lang.Integer articleId)
                              throws DAOException
Deletes a Article with a given a ArticleId.

DAOException

updateByArticleId

public static void updateByArticleId(Article article)
                              throws DAOException
Updates a Article, using its primary key ArticleId.

DAOException

selectByArticleId

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

DAOException

selectByBody

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

DAOException

selectByMemberId

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

DAOException

selectBySpecial

public static java.util.Collection selectBySpecial(java.lang.Boolean special)
                                            throws DAOException
Select all rows from the ARTICLE table, given a special. Then returns each row as one instance of Article, all of them inside a Collection. It never returns null, maybe an empty Collection.

DAOException