edu.rice.rubis.beans
Class IDManagerBean

java.lang.Object
  |
  +--edu.rice.rubis.beans.IDManagerBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, javax.ejb.EntityBean, java.io.Serializable

public class IDManagerBean
extends java.lang.Object
implements javax.ejb.EntityBean

IDManagerBean is used to generate id since the AUTO_INCREMENT feature of the database that automatically generate id on the primary key is not supported by JBoss.

Version:
1.1
Author:
Emmanuel Cecchet and Julie Marguerite
See Also:
Serialized Form

Field Summary
 java.lang.Integer bidCount
           
 java.lang.Integer buyNowCount
           
 java.lang.Integer categoryCount
           
 java.lang.Integer commentCount
           
 java.lang.Integer id
           
 java.lang.Integer itemCount
           
 java.lang.Integer regionCount
           
 java.lang.Integer userCount
           
 
Constructor Summary
IDManagerBean()
           
 
Method Summary
 void ejbActivate()
          This method is empty because persistence is managed by the container
 IDManagerPK ejbCreate()
          This method is used to create a new IDManager Bean but should never be called.
 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()
          This method does currently nothing
 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 IDManager id.
 java.lang.Integer getNextBidID()
          Generate the bid id.
 java.lang.Integer getNextBuyNowID()
          Generate the buyNow id.
 java.lang.Integer getNextCategoryID()
          Generate the category id.
 java.lang.Integer getNextCommentID()
          Generate the comment id.
 java.lang.Integer getNextItemID()
          Generate the item id.
 java.lang.Integer getNextRegionID()
          Generate the region id.
 java.lang.Integer getNextUserID()
          Generate the user id.
 boolean isModified()
          Returns true if the beans has been modified.
 void setEntityContext(javax.ejb.EntityContext context)
          Sets the associated entity context.
 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

id

public java.lang.Integer id

categoryCount

public java.lang.Integer categoryCount

regionCount

public java.lang.Integer regionCount

userCount

public java.lang.Integer userCount

itemCount

public java.lang.Integer itemCount

commentCount

public java.lang.Integer commentCount

bidCount

public java.lang.Integer bidCount

buyNowCount

public java.lang.Integer buyNowCount
Constructor Detail

IDManagerBean

public IDManagerBean()
Method Detail

getId

public java.lang.Integer getId()
                        throws java.rmi.RemoteException
Get IDManager id.
Returns:
IDManager id
Throws:
java.rmi.RemoteException - if an error occurs
Since:
1.0

getNextCategoryID

public java.lang.Integer getNextCategoryID()
                                    throws java.rmi.RemoteException
Generate the category id.
Returns:
Value of the ID
Since:
1.1

getNextRegionID

public java.lang.Integer getNextRegionID()
                                  throws java.rmi.RemoteException
Generate the region id.
Returns:
Value of the ID
Since:
1.1

getNextUserID

public java.lang.Integer getNextUserID()
                                throws java.rmi.RemoteException
Generate the user id.
Returns:
Value of the ID
Since:
1.1

getNextItemID

public java.lang.Integer getNextItemID()
                                throws java.rmi.RemoteException
Generate the item id.
Returns:
Value of the ID
Since:
1.1

getNextCommentID

public java.lang.Integer getNextCommentID()
                                   throws java.rmi.RemoteException
Generate the comment id.
Returns:
Value of the ID
Since:
1.1

getNextBidID

public java.lang.Integer getNextBidID()
                               throws java.rmi.RemoteException
Generate the bid id.
Returns:
Value of the ID
Since:
1.1

getNextBuyNowID

public java.lang.Integer getNextBuyNowID()
                                  throws java.rmi.RemoteException
Generate the buyNow id.
Returns:
Value of the ID
Since:
1.1

ejbCreate

public IDManagerPK ejbCreate()
                      throws javax.ejb.CreateException,
                             java.rmi.RemoteException,
                             javax.ejb.RemoveException
This method is used to create a new IDManager Bean but should never be called.
Returns:
pk primary key set to null
Throws:
javax.ejb.CreateException - if an error occurs
java.rmi.RemoteException - if an error occurs
javax.ejb.RemoveException - if an error occurs

ejbPostCreate

public void ejbPostCreate()
This method does currently nothing

ejbActivate

public void ejbActivate()
                 throws java.rmi.RemoteException
This method is empty because persistence is managed by the container
Specified by:
ejbActivate in interface javax.ejb.EntityBean

ejbPassivate

public void ejbPassivate()
                  throws java.rmi.RemoteException
This method is empty because persistence is managed by the container
Specified by:
ejbPassivate in interface javax.ejb.EntityBean

ejbRemove

public void ejbRemove()
               throws java.rmi.RemoteException,
                      javax.ejb.RemoveException
This method is empty because persistence is managed by the container
Specified by:
ejbRemove in interface javax.ejb.EntityBean

ejbStore

public void ejbStore()
              throws java.rmi.RemoteException
Persistence is managed by the container and the bean becomes up to date
Specified by:
ejbStore in interface javax.ejb.EntityBean

ejbLoad

public void ejbLoad()
             throws java.rmi.RemoteException
Persistence is managed by the container and the bean becomes up to date
Specified by:
ejbLoad in interface javax.ejb.EntityBean

setEntityContext

public void setEntityContext(javax.ejb.EntityContext context)
                      throws java.rmi.RemoteException
Sets the associated entity context. The container invokes this method on an instance after the instance has been created. This method is called in an unspecified transaction context.
Specified by:
setEntityContext in interface javax.ejb.EntityBean
Parameters:
context - - An EntityContext interface for the instance. The instance should store the reference to the context in an instance variable.
Throws:
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.

unsetEntityContext

public void unsetEntityContext()
                        throws java.rmi.RemoteException
Unsets the associated entity context. The container calls this method before removing the instance. This is the last method that the container invokes on the instance. The Java garbage collector will eventually invoke the finalize() method on the instance. This method is called in an unspecified transaction context.
Specified by:
unsetEntityContext in interface javax.ejb.EntityBean
Throws:
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.

isModified

public boolean isModified()
Returns true if the beans has been modified. It prevents the EJB server from reloading a bean that has not been modified.
Returns:
a boolean value


Copyright © 2003 - ObjectWeb Consortium - All Rights Reserved.