test.tester.model.dao
Class StoryPictureBroker

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

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

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

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

     while (iterator.hasNext()) {
         StoryPicture storyPicture = (StoryPicture) iterator.next();
         System.out.println(storyPicture.toString());
     }
     
 

See Also:
StoryPicture

Constructor Summary
StoryPictureBroker()
           
 
Method Summary
static int count()
          Gets how many rows has this table.
static void deleteByStoryPictureId(java.lang.Integer storyPictureId)
          Deletes a StoryPicture with a given a StoryPictureId.
static void insert(StoryPicture storyPicture)
          Inserts a new StoryPicture in the database.
static java.util.Collection selectAll()
          Select all rows from the STORY_PICTURE, and then returns each row as one instance of StoryPicture, all of them inside a Collection.
static java.util.Collection selectByBody(java.io.ByteArrayInputStream body)
          Select all rows from the STORY_PICTURE table, given a body.
static java.util.Collection selectByStoryId(java.lang.Integer storyId)
          Select all rows from the STORY_PICTURE table, given a storyId.
static StoryPicture selectByStoryPictureId(java.lang.Integer storyPictureId)
          Select a row from the STORY_PICTURE table, given a storyPictureId.
static java.util.Collection selectByThumbnail(java.io.ByteArrayInputStream thumbnail)
          Select all rows from the STORY_PICTURE table, given a thumbnail.
static java.util.Collection selectByTitle(java.lang.String title)
          Select all rows from the STORY_PICTURE table, given a title.
static void updateByStoryPictureId(StoryPicture storyPicture)
          Updates a StoryPicture, using its primary key StoryPictureId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoryPictureBroker

public StoryPictureBroker()
Method Detail

selectAll

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

DAOException

deleteByStoryPictureId

public static void deleteByStoryPictureId(java.lang.Integer storyPictureId)
                                   throws DAOException
Deletes a StoryPicture with a given a StoryPictureId.

DAOException

updateByStoryPictureId

public static void updateByStoryPictureId(StoryPicture storyPicture)
                                   throws DAOException
Updates a StoryPicture, using its primary key StoryPictureId.

DAOException

selectByStoryPictureId

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

DAOException

selectByStoryId

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

DAOException