test.tester.model.dao
Class ArticlePictureBroker

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

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

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

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

     while (iterator.hasNext()) {
         ArticlePicture articlePicture = (ArticlePicture) iterator.next();
         System.out.println(articlePicture.toString());
     }
     
 

See Also:
ArticlePicture

Constructor Summary
ArticlePictureBroker()
           
 
Method Summary
static int count()
          Gets how many rows has this table.
static void deleteByArticlePictureId(java.lang.Integer articlePictureId)
          Deletes a ArticlePicture with a given a ArticlePictureId.
static void insert(ArticlePicture articlePicture)
          Inserts a new ArticlePicture in the database.
static java.util.Collection selectAll()
          Select all rows from the ARTICLE_PICTURE, and then returns each row as one instance of ArticlePicture, all of them inside a Collection.
static java.util.Collection selectByArticleId(java.lang.Integer articleId)
          Select all rows from the ARTICLE_PICTURE table, given a articleId.
static ArticlePicture selectByArticlePictureId(java.lang.Integer articlePictureId)
          Select a row from the ARTICLE_PICTURE table, given a articlePictureId.
static java.util.Collection selectByBody(java.io.ByteArrayInputStream body)
          Select all rows from the ARTICLE_PICTURE table, given a body.
static java.util.Collection selectByThumbnail(java.io.ByteArrayInputStream thumbnail)
          Select all rows from the ARTICLE_PICTURE table, given a thumbnail.
static java.util.Collection selectByTitle(java.lang.String title)
          Select all rows from the ARTICLE_PICTURE table, given a title.
static void updateByArticlePictureId(ArticlePicture articlePicture)
          Updates a ArticlePicture, using its primary key ArticlePictureId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArticlePictureBroker

public ArticlePictureBroker()
Method Detail

selectAll

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

DAOException

deleteByArticlePictureId

public static void deleteByArticlePictureId(java.lang.Integer articlePictureId)
                                     throws DAOException
Deletes a ArticlePicture with a given a ArticlePictureId.

DAOException

updateByArticlePictureId

public static void updateByArticlePictureId(ArticlePicture articlePicture)
                                     throws DAOException
Updates a ArticlePicture, using its primary key ArticlePictureId.

DAOException

selectByArticlePictureId

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

DAOException

selectByThumbnail

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

DAOException

selectByArticleId

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

DAOException