|
||||||||
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 "container 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()
This method is empty because persistence is managed by the container |
CategoryPK |
ejbCreate(java.lang.String categoryName)
This method is used to create a new Category Bean. |
void |
ejbLoad()
Persistence is managed by the container and the bean becomes up to date |
void |
ejbPassivate()
This method is empty because persistence is managed by the container |
void |
ejbPostCreate(java.lang.String categoryName)
This method just set an internal flag to reload the id generated by the DB |
void |
ejbRemove()
This method is empty because persistence is managed by the container |
void |
ejbStore()
Persistence is managed by the container and the bean becomes up to date |
java.lang.Integer |
getId()
Get category's id. |
java.lang.String |
getName()
Get the category name. |
boolean |
isModified()
Returns true if the beans has been modified. |
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()
public java.lang.String getName()
public void setName(java.lang.String newName)
newName
- category namepublic CategoryPK ejbCreate(java.lang.String categoryName) throws javax.ejb.CreateException
categoryName
- Category namejavax.ejb.CreateException
- if an error occurspublic void ejbPostCreate(java.lang.String categoryName)
public void ejbLoad()
ejbLoad
in interface javax.ejb.EntityBean
public void ejbStore()
ejbStore
in interface javax.ejb.EntityBean
public void ejbActivate()
ejbActivate
in interface javax.ejb.EntityBean
public void ejbPassivate()
ejbPassivate
in interface javax.ejb.EntityBean
public void ejbRemove()
ejbRemove
in interface javax.ejb.EntityBean
public void setEntityContext(javax.ejb.EntityContext context)
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.public void unsetEntityContext()
unsetEntityContext
in interface javax.ejb.EntityBean
javax.ejb.EJBException
- Thrown by the method to indicate a failure
caused by a system-level error.public java.lang.String printCategory()
String
containing HTML codepublic java.lang.String printCategoryByRegion(int regionId)
String
containing HTML codepublic boolean isModified()
boolean
valuepublic java.lang.String printCategoryToSellItem(int userId)
String
containing HTML code
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |