com.opensymphony.module.propertyset.ejb.types
Class NumberEntityEJB

java.lang.Object
  extended bycom.opensymphony.module.propertyset.ejb.types.NumberEntityEJB
All Implemented Interfaces:
javax.ejb.EnterpriseBean, javax.ejb.EntityBean, java.io.Serializable
Direct Known Subclasses:
PropertyNumberCMP

public abstract class NumberEntityEJB
extends java.lang.Object
implements javax.ejb.EntityBean

AbstractValueEntityEJB concrete implementation optimized for storing numbers. This can be used to store BOOLEAN, INT and LONG.

Version:
$Revision: 1.3 $
Author:
Hani Suleiman, Joe Walnes
See Also:
PropertyStoreEJB, Serialized Form

Constructor Summary
NumberEntityEJB()
           
 
Method Summary
protected  int[] allowedTypes()
          Returns { PropertySet.BOOLEAN, PropertySet.INT, PropertySet.LONG }
 void ejbActivate()
           
 java.lang.Long ejbCreate(int type, long id)
           
 void ejbLoad()
           
 void ejbPassivate()
           
 void ejbPostCreate(int type, long id)
           
 void ejbRemove()
           
 void ejbStore()
           
abstract  java.lang.Long getId()
           
abstract  long getNumber()
           
 java.io.Serializable getValue(int type)
          Create appropriate wrapper object around value (Boolean, Integer, Long).
 void setEntityContext(javax.ejb.EntityContext context)
           
abstract  void setId(java.lang.Long id)
           
abstract  void setNumber(long date)
           
 void setValue(int type, java.io.Serializable value)
          Set the value.
 void unsetEntityContext()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberEntityEJB

public NumberEntityEJB()
Method Detail

setId

public abstract void setId(java.lang.Long id)

getId

public abstract java.lang.Long getId()

setNumber

public abstract void setNumber(long date)

getNumber

public abstract long getNumber()

setEntityContext

public void setEntityContext(javax.ejb.EntityContext context)
Specified by:
setEntityContext in interface javax.ejb.EntityBean

setValue

public void setValue(int type,
                     java.io.Serializable value)
Set the value. Only java.lang.Number, java.lang.Boolean or java.util.Date can be supplied.


getValue

public java.io.Serializable getValue(int type)
Create appropriate wrapper object around value (Boolean, Integer, Long).


ejbActivate

public void ejbActivate()
Specified by:
ejbActivate in interface javax.ejb.EntityBean

ejbCreate

public java.lang.Long ejbCreate(int type,
                                long id)
                         throws javax.ejb.CreateException
Throws:
javax.ejb.CreateException

ejbLoad

public void ejbLoad()
Specified by:
ejbLoad in interface javax.ejb.EntityBean

ejbPassivate

public void ejbPassivate()
Specified by:
ejbPassivate in interface javax.ejb.EntityBean

ejbPostCreate

public void ejbPostCreate(int type,
                          long id)
                   throws javax.ejb.CreateException
Throws:
javax.ejb.CreateException

ejbRemove

public void ejbRemove()
               throws javax.ejb.RemoveException
Specified by:
ejbRemove in interface javax.ejb.EntityBean
Throws:
javax.ejb.RemoveException

ejbStore

public void ejbStore()
Specified by:
ejbStore in interface javax.ejb.EntityBean

unsetEntityContext

public void unsetEntityContext()
Specified by:
unsetEntityContext in interface javax.ejb.EntityBean

allowedTypes

protected int[] allowedTypes()
Returns { PropertySet.BOOLEAN, PropertySet.INT, PropertySet.LONG }


See www.opensymphony.com for more information.

Copyright 2000-2005 - OpenSymphony