|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--test.tester.model.dao.StoryBroker
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 Story
,
like selectById(Integer)
.
Here is one example for getting ALL rows from the STORY
table:
// as you can see, it is a static method // you can use here any of the select*(...) methods Collection result = StoryBroker.selectAll(); Iterator iterator = result.iterator(); while (iterator.hasNext()) { Story story = (Story) iterator.next(); System.out.println(story.toString()); }
Story
Constructor Summary | |
StoryBroker()
|
Method Summary | |
static int |
count()
Gets how many rows has this table. |
static void |
deleteByStoryId(java.lang.Integer storyId)
Deletes a Story with a given a
StoryId . |
static void |
insert(Story story)
Inserts a new Story in the database. |
static java.util.Collection |
selectAll()
Select all rows from the STORY , and then returns each row as one instance of
Story , all of them inside a Collection. |
static java.util.Collection |
selectByBody(java.lang.String body)
Select all rows from the STORY table, given a body . |
static java.util.Collection |
selectByCategoryId(java.lang.Integer categoryId)
Select all rows from the STORY table, given a categoryId . |
static java.util.Collection |
selectByDay(java.lang.String day)
Select all rows from the STORY table, given a day . |
static java.util.Collection |
selectByMemberId(java.lang.Integer memberId)
Select all rows from the STORY table, given a memberId . |
static Story |
selectByStoryId(java.lang.Integer storyId)
Select a row from the STORY table, given a storyId . |
static java.util.Collection |
selectBySubtitle(java.lang.String subtitle)
Select all rows from the STORY table, given a subtitle . |
static java.util.Collection |
selectByTitle(java.lang.String title)
Select all rows from the STORY table, given a title . |
static void |
updateByStoryId(Story story)
Updates a Story , using its primary key
StoryId . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StoryBroker()
Method Detail |
public static java.util.Collection selectAll() throws DAOException
STORY
, and then returns each row as one instance of
Story
, all of them inside a Collection. It never returns null, maybe a
empty Collection.
DAOException
public static int count() throws DAOException
DAOException
public static void insert(Story story) throws DAOException
Story
in the database.
DAOException
public static void deleteByStoryId(java.lang.Integer storyId) throws DAOException
Story
with a given a
StoryId
.
DAOException
public static void updateByStoryId(Story story) throws DAOException
Story
, using its primary key
StoryId
.
DAOException
public static Story selectByStoryId(java.lang.Integer storyId) throws DAOException
STORY
table, given a storyId
.
As storyId
is a primary key, there is no need
to return a Collection
.
DAOException
public static java.util.Collection selectByTitle(java.lang.String title) throws DAOException
STORY
table, given a title
.
Then returns each row as one instance of Story
, all of them inside a
Collection. It never returns null, maybe an empty Collection
.
DAOException
public static java.util.Collection selectBySubtitle(java.lang.String subtitle) throws DAOException
STORY
table, given a subtitle
.
Then returns each row as one instance of Story
, all of them inside a
Collection. It never returns null, maybe an empty Collection
.
DAOException
public static java.util.Collection selectByBody(java.lang.String body) throws DAOException
STORY
table, given a body
.
Then returns each row as one instance of Story
, all of them inside a
Collection. It never returns null, maybe an empty Collection
.
DAOException
public static java.util.Collection selectByDay(java.lang.String day) throws DAOException
STORY
table, given a day
.
Then returns each row as one instance of Story
, all of them inside a
Collection. It never returns null, maybe an empty Collection
.
DAOException
public static java.util.Collection selectByCategoryId(java.lang.Integer categoryId) throws DAOException
STORY
table, given a categoryId
.
Then returns each row as one instance of Story
, all of them inside a
Collection. It never returns null, maybe an empty Collection
.
DAOException
public static java.util.Collection selectByMemberId(java.lang.Integer memberId) throws DAOException
STORY
table, given a memberId
.
Then returns each row as one instance of Story
, all of them inside a
Collection. It never returns null, maybe an empty Collection
.
DAOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |