|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.rice.rubis.beans.CategoryBean
CategoryBean is an entity bean with "bean managed persistence". The state of an instance is stored into a relational database. The following table should exist:
CREATE TABLE categories ( id INTEGER UNSIGNED NOT NULL UNIQUE name VARCHAR(50), PRIMARY KEY(id) );
Field Summary | |
java.lang.Integer |
id
|
java.lang.String |
name
|
Constructor Summary | |
CategoryBean()
|
Method Summary | |
void |
ejbActivate()
Mandatory methods |
CategoryPK |
ejbCreate(java.lang.String categoryName)
This method is used to create a new Category Bean. |
java.util.Collection |
ejbFindAllCategories()
This method is used to retrieve all categories from the database! |
CategoryPK |
ejbFindByName(java.lang.String categoryName)
This method is used to retrieve a Category Bean from its name. |
CategoryPK |
ejbFindByPrimaryKey(CategoryPK id)
This method is used to retrieve a Category Bean from its primary key, that is to say its id. |
void |
ejbLoad()
Read the reccord from the database and update the bean. |
void |
ejbPassivate()
|
void |
ejbPostCreate(java.lang.String categoryName)
This method does currently nothing |
void |
ejbRemove()
This method delete the record from the database. |
void |
ejbStore()
Update the record. |
java.sql.Connection |
getConnection()
Retrieve a connection.. |
java.lang.Integer |
getId()
Get category's id. |
java.lang.String |
getName()
Get the category name. |
java.lang.String |
printCategory()
Display category information for the BrowseCategories servlet |
java.lang.String |
printCategoryByRegion(int regionId)
Display category information for the BrowseCategories servlet |
java.lang.String |
printCategoryToSellItem(int userId)
Display category information for the BrowseCategories servlet |
void |
setEntityContext(javax.ejb.EntityContext context)
Sets the associated entity context. |
void |
setName(java.lang.String newName)
Set category's name |
void |
unsetEntityContext()
Unsets the associated entity context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public java.lang.Integer id
public java.lang.String name
Constructor Detail |
public CategoryBean()
Method Detail |
public java.lang.Integer getId() throws java.rmi.RemoteException
java.rmi.RemoteException
- if an error occurspublic java.lang.String getName() throws java.rmi.RemoteException
java.rmi.RemoteException
- if an error occurspublic void setName(java.lang.String newName) throws java.rmi.RemoteException
newName
- category namejava.rmi.RemoteException
- if an error occurspublic java.sql.Connection getConnection() throws java.lang.Exception
java.lang.Exception
- if an error occurspublic CategoryPK ejbFindByPrimaryKey(CategoryPK id) throws javax.ejb.FinderException, java.rmi.RemoteException
id
- Region id (primary key)javax.ejb.FinderException
- if an error occursjava.rmi.RemoteException
- if an error occurspublic CategoryPK ejbFindByName(java.lang.String categoryName) throws javax.ejb.FinderException, java.rmi.RemoteException
categoryName
- Category namejavax.ejb.FinderException
- if an error occursjava.rmi.RemoteException
- if an error occurspublic java.util.Collection ejbFindAllCategories() throws java.rmi.RemoteException, javax.ejb.FinderException
java.rmi.RemoteException
- if an error occursjavax.ejb.FinderException
- if an error occurspublic CategoryPK ejbCreate(java.lang.String categoryName) throws javax.ejb.CreateException, java.rmi.RemoteException, javax.ejb.RemoveException
categoryName
- Category namejavax.ejb.CreateException
- if an error occursjava.rmi.RemoteException
- if an error occursjavax.ejb.RemoveException
- if an error occurspublic void ejbPostCreate(java.lang.String categoryName)
public void ejbActivate() throws java.rmi.RemoteException
ejbActivate
in interface javax.ejb.EntityBean
public void ejbPassivate() throws java.rmi.RemoteException
ejbPassivate
in interface javax.ejb.EntityBean
public void ejbRemove() throws java.rmi.RemoteException, javax.ejb.RemoveException
ejbRemove
in interface javax.ejb.EntityBean
java.rmi.RemoteException
- if an error occursjavax.ejb.RemoveException
- if an error occurspublic void ejbStore() throws java.rmi.RemoteException
ejbStore
in interface javax.ejb.EntityBean
java.rmi.RemoteException
- if an error occurspublic void ejbLoad() throws java.rmi.RemoteException
ejbLoad
in interface javax.ejb.EntityBean
java.rmi.RemoteException
- if an error occurspublic void setEntityContext(javax.ejb.EntityContext context) throws java.rmi.RemoteException
setEntityContext
in interface javax.ejb.EntityBean
context
- - An EntityContext interface for the instance. The instance should
store the reference to the context in an instance variable.javax.ejb.EJBException
- Thrown by the method to indicate a failure
caused by a system-level error.java.rmi.RemoteException
- - This exception is defined in the method signature
to provide backward compatibility for enterprise beans
written for the EJB 1.0 specification.
Enterprise beans written for the EJB 1.1 and
higher specification should throw the javax.ejb.EJBException
instead of this exception.public void unsetEntityContext() throws java.rmi.RemoteException
unsetEntityContext
in interface javax.ejb.EntityBean
javax.ejb.EJBException
- Thrown by the method to indicate a failure
caused by a system-level error.java.rmi.RemoteException
- - This exception is defined in the method signature
to provide backward compatibility for enterprise beans
written for the EJB 1.0 specification.
Enterprise beans written for the EJB 1.1 and
higher specification should throw the javax.ejb.EJBException
instead of this exception.public java.lang.String printCategory() throws java.rmi.RemoteException
String
containing HTML codejava.rmi.RemoteException
- if an error occurspublic java.lang.String printCategoryByRegion(int regionId) throws java.rmi.RemoteException
regionId
- an int
valueString
containing HTML codejava.rmi.RemoteException
- if an error occurspublic java.lang.String printCategoryToSellItem(int userId) throws java.rmi.RemoteException
userId
- an int
valueString
containing HTML codejava.rmi.RemoteException
- if an error occurs
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |