|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--test.tester.model.dao.LinkBroker
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()); }
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 |
public LinkBroker()
Method Detail |
public static java.util.Collection selectAll() throws DAOException
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
public static int count() throws DAOException
DAOException
public static void insert(Link link) throws DAOException
Link
in the database.
DAOException
public static void deleteByLinkId(java.lang.Integer linkId) throws DAOException
Link
with a given a
LinkId
.
DAOException
public static void updateByLinkId(Link link) throws DAOException
Link
, using its primary key
LinkId
.
DAOException
public static Link selectByLinkId(java.lang.Integer linkId) throws DAOException
LINK
table, given a linkId
.
As linkId
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
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
public static java.util.Collection selectBySubtitle(java.lang.String subtitle) throws DAOException
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
public static java.util.Collection selectByLink(java.lang.String link) throws DAOException
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
public static java.util.Collection selectByCategoryId(java.lang.Integer categoryId) throws DAOException
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |