Betty v1.1.0

christophedelory.betty.ejb
Class MetadataBean

java.lang.Object
  extended by christophedelory.ejb.AbstractEntityBean
      extended by christophedelory.betty.ejb.MetadataBean
All Implemented Interfaces:
DbEntity, Serializable, EnterpriseBean, EntityBean

public abstract class MetadataBean
extends AbstractEntityBean
implements EntityBean, DbEntity

The entity bean definition of a metadata field, attached to a base object.

Version:
$Revision: 85 $
Author:
Christophe Delory
See Also:
AbstractMetadataDetails, Serialized Form

Field Summary
 
Fields inherited from class christophedelory.ejb.AbstractEntityBean
context
 
Constructor Summary
MetadataBean()
           
 
Method Summary
 Object ejbCreate(LocalBase dbBase, String type, String localeName)
          Creates an instance of this entity bean.
 void ejbPostCreate(LocalBase dbBase, String type, String localeName)
          Allows this entity bean instance to fully initialize itself.
abstract  LocalBase getBase()
          Returns the base EJB object attached to this EJB object.
abstract  Date getCreationDate()
          Returns the creation date of this EJB object.
abstract  String getCreationUserId()
          Returns the identifier of the user having created this EJB object.
abstract  String getLocaleName()
          Returns the metadata locale.
abstract  String getType()
          Returns the metadata type.
abstract  Date getUpdateDate()
          Returns the update date of this EJB object.
abstract  String getUpdateUserId()
          Returns the identifier of the user having performed the last update on this EJB object.
abstract  String getValue()
          Returns the value of this metadata.
abstract  void setBase(LocalBase dbBase)
          Initializes the associated EJB object.
abstract  void setCreationDate(Date date)
          Initializes the creation date.
abstract  void setCreationUserId(String userId)
          Initializes the identifier of the user having created this EJB object.
abstract  void setLocaleName(String localeName)
          Initializes the metadata locale.
abstract  void setType(String type)
          Initializes the metadata type.
abstract  void setUpdateDate(Date date)
          Initializes the update date of this EJB object.
abstract  void setUpdateUserId(String userId)
          Initializes the identifier of the user having performed the last update on this EJB object.
abstract  void setValue(String value)
          Initializes the value of this metadata.
 
Methods inherited from class christophedelory.ejb.AbstractEntityBean
ejbActivate, ejbLoad, ejbPassivate, ejbRemove, ejbStore, setEntityContext, unsetEntityContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.ejb.EntityBean
ejbActivate, ejbLoad, ejbPassivate, ejbRemove, ejbStore, setEntityContext, unsetEntityContext
 

Constructor Detail

MetadataBean

public MetadataBean()
Method Detail

getType

public abstract String getType()
Returns the metadata type.

Returns:
the metadata type. Shall not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
DescriptionDetails.METADATA_TYPE, LinkDetails.METADATA_TYPE, setType(String)

setType

public abstract void setType(String type)
Initializes the metadata type.

Parameters:
type - a metadata type. Shall not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
getType()

getLocaleName

public abstract String getLocaleName()
Returns the metadata locale.

Returns:
a locale name. May be empty, but not null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
setLocaleName(String)

setLocaleName

public abstract void setLocaleName(String localeName)
Initializes the metadata locale.

Parameters:
localeName - a locale name. May be empty, but not null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
getLocaleName()

getValue

public abstract String getValue()
Returns the value of this metadata.

Returns:
a metadata value. Shall not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
setValue(String)

setValue

public abstract void setValue(String value)
Initializes the value of this metadata.

Parameters:
value - a metadata value. Shall not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
getValue()

getCreationDate

public abstract Date getCreationDate()
Description copied from interface: DbEntity
Returns the creation date of this EJB object.

Specified by:
getCreationDate in interface DbEntity
Returns:
a date. Shall not be null.
See Also:
setCreationDate(java.util.Date)

setCreationDate

public abstract void setCreationDate(Date date)
Initializes the creation date.

Parameters:
date - a date. Shall not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
getCreationDate()

getCreationUserId

public abstract String getCreationUserId()
Description copied from interface: DbEntity
Returns the identifier of the user having created this EJB object.

Specified by:
getCreationUserId in interface DbEntity
Returns:
a user identifier. Shall not be null.
See Also:
setCreationUserId(String)

setCreationUserId

public abstract void setCreationUserId(String userId)
Initializes the identifier of the user having created this EJB object.

Parameters:
userId - a user identifier. Shall not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
getCreationUserId()

getUpdateDate

public abstract Date getUpdateDate()
Description copied from interface: DbEntity
Returns the update date of this EJB object.

Specified by:
getUpdateDate in interface DbEntity
Returns:
a date. Shall not be null.
See Also:
DbEntity.setUpdateDate(java.util.Date), DbEntity.getUpdateUserId()

setUpdateDate

public abstract void setUpdateDate(Date date)
Description copied from interface: DbEntity
Initializes the update date of this EJB object.

Specified by:
setUpdateDate in interface DbEntity
Parameters:
date - a date. Shall not be null.
See Also:
DbEntity.getUpdateDate(), DbEntity.setUpdateUserId(String)

getUpdateUserId

public abstract String getUpdateUserId()
Description copied from interface: DbEntity
Returns the identifier of the user having performed the last update on this EJB object.

Specified by:
getUpdateUserId in interface DbEntity
Returns:
a user identifier. Shall not be null.
See Also:
DbEntity.setUpdateUserId(String), DbEntity.getUpdateDate()

setUpdateUserId

public abstract void setUpdateUserId(String userId)
Description copied from interface: DbEntity
Initializes the identifier of the user having performed the last update on this EJB object.

Specified by:
setUpdateUserId in interface DbEntity
Parameters:
userId - a user identifier. Shall not be null.
See Also:
DbEntity.getUpdateUserId(), DbEntity.setUpdateDate(java.util.Date)

getBase

public abstract LocalBase getBase()
Description copied from interface: DbEntity
Returns the base EJB object attached to this EJB object.
Foreign key fields must be nullable by default. This is because the CMP specification requires an insert into the database after the ejbCreate method and an update to it after to pick up CMR changes made in ejbPostCreate. Since the EJB specification does not allow a relationship to be modified until ejbPostCreate, a foreign key will be initially set to null.

Specified by:
getBase in interface DbEntity
Returns:
a base EJB object. Shall not be null.
See Also:
DbEntity.setBase(christophedelory.interfaces.LocalBase)

setBase

public abstract void setBase(LocalBase dbBase)
Description copied from interface: DbEntity
Initializes the associated EJB object.

Specified by:
setBase in interface DbEntity
Parameters:
dbBase - an EJB object. Shall not be null.
See Also:
DbEntity.getBase()

ejbCreate

public Object ejbCreate(LocalBase dbBase,
                        String type,
                        String localeName)
                 throws CreateException
Creates an instance of this entity bean.

Parameters:
dbBase - the EJB object owning this metadata. Shall not be null.
type - the metadata type. Shall not be null.
localeName - a locale name. May be empty, but not null.
Returns:
null (as EJB 2.0 spec says for CMP ejbCreate() methods).
Throws:
NullPointerException - if type is null.
CreateException - the EJB object creation failed.
EJBException - if any exception occured during the execution of this method.

ejbPostCreate

public void ejbPostCreate(LocalBase dbBase,
                          String type,
                          String localeName)
                   throws CreateException
Allows this entity bean instance to fully initialize itself.

Parameters:
dbBase - the EJB object owning this metadata. Shall not be null.
type - the metadata type. Shall not be null.
localeName - a locale name. May be empty, but not null.
Throws:
CreateException - the EJB object creation failed.
EJBException - if any exception occured during the execution of this method.

© 2008-2009 Christophe Delory

Copyright © 2008-2009 Christophe Delory. All Rights Reserved.