org.apache.openejb.jee
Class EntityBean

java.lang.Object
  extended by org.apache.openejb.jee.EntityBean
All Implemented Interfaces:
EnterpriseBean, JndiConsumer, Lifecycle, RemoteBean

public class EntityBean
extends java.lang.Object
implements RemoteBean

The entity-beanType declares an entity bean. The declaration consists of:

- an optional description - an optional display name - an optional icon element that contains a small and a large icon file name - a unique name assigned to the enterprise bean in the deployment descriptor - an optional mapped-name element that can be used to provide vendor-specific deployment information such as the physical jndi-name of the entity bean's remote home interface. This element is not required to be supported by all implementations. Any use of this element is non-portable. - the names of the entity bean's remote home and remote interfaces, if any - the names of the entity bean's local home and local interfaces, if any - the entity bean's implementation class - the optional entity bean's persistence management type. If this element is not specified it is defaulted to Container. - the entity bean's primary key class name - an indication of the entity bean's reentrancy - an optional specification of the entity bean's cmp-version - an optional specification of the entity bean's abstract schema name - an optional list of container-managed fields - an optional specification of the primary key field - an optional declaration of the bean's environment entries - an optional declaration of the bean's EJB references - an optional declaration of the bean's local EJB references - an optional declaration of the bean's web service references - an optional declaration of the security role references - an optional declaration of the security identity to be used for the execution of the bean's methods - an optional declaration of the bean's resource manager connection factory references - an optional declaration of the bean's resource environment references - an optional declaration of the bean's message destination references - an optional set of query declarations for finder and select methods for an entity bean with cmp-version 2.x.

The optional abstract-schema-name element must be specified for an entity bean with container-managed persistence and cmp-version 2.x.

The optional primkey-field may be present in the descriptor if the entity's persistence-type is Container.

The optional cmp-version element may be present in the descriptor if the entity's persistence-type is Container. If the persistence-type is Container and the cmp-version element is not specified, its value defaults to 2.x.

The optional home and remote elements must be specified if the entity bean cmp-version is 1.x.

The optional home and remote elements must be specified if the entity bean has a remote home and remote interface.

The optional local-home and local elements must be specified if the entity bean has a local home and local interface.

Either both the local-home and the local elements or both the home and the remote elements must be specified.

The optional query elements must be present if the persistence-type is Container and the cmp-version is 2.x and query methods other than findByPrimaryKey have been defined for the entity bean.

The other elements that are optional are "optional" in the sense that they are omitted if the lists represented by them are empty.

At least one cmp-field element must be present in the descriptor if the entity's persistence-type is Container and the cmp-version is 1.x, and none must not be present if the entity's persistence-type is Bean.


Field Summary
protected  java.lang.String abstractSchemaName
           
protected  java.util.List<CmpField> cmpField
           
protected  CmpVersion cmpVersion
           
protected  TextMap description
           
protected  TextMap displayName
           
protected  java.lang.String ejbClass
           
protected  KeyedCollection<java.lang.String,EjbLocalRef> ejbLocalRef
           
protected  java.lang.String ejbName
           
protected  KeyedCollection<java.lang.String,EjbRef> ejbRef
           
protected  KeyedCollection<java.lang.String,EnvEntry> envEntry
           
protected  java.lang.String home
           
protected  LocalCollection<Icon> icon
           
protected  java.lang.String id
           
protected  java.lang.String local
           
protected  java.lang.String localHome
           
protected  java.lang.String mappedName
           
protected  KeyedCollection<java.lang.String,MessageDestinationRef> messageDestinationRef
           
protected  KeyedCollection<java.lang.String,PersistenceContextRef> persistenceContextRef
           
protected  PersistenceType persistenceType
           
protected  KeyedCollection<java.lang.String,PersistenceUnitRef> persistenceUnitRef
           
protected  java.util.List<LifecycleCallback> postConstruct
           
protected  java.util.List<LifecycleCallback> preDestroy
           
protected  java.lang.String primKeyClass
           
protected  java.lang.String primkeyField
           
protected  java.util.List<Query> query
           
protected  boolean reentrant
           
protected  java.lang.String remote
           
protected  KeyedCollection<java.lang.String,ResourceEnvRef> resourceEnvRef
           
protected  KeyedCollection<java.lang.String,ResourceRef> resourceRef
           
protected  SecurityIdentity securityIdentity
           
protected  java.util.List<SecurityRoleRef> securityRoleRef
           
protected  KeyedCollection<java.lang.String,ServiceRef> serviceRef
           
 
Constructor Summary
EntityBean()
           
 
Method Summary
 void addAroundInvoke(java.lang.String method)
           
 void addCmpField(java.lang.String fieldName)
           
 void addPostConstruct(java.lang.String method)
           
 void addPreDestroy(java.lang.String method)
           
 java.lang.String getAbstractSchemaName()
           
 java.util.List<AroundInvoke> getAroundInvoke()
           
 java.util.Collection<java.lang.String> getBusinessLocal()
           
 java.util.Collection<java.lang.String> getBusinessRemote()
           
 java.util.List<CmpField> getCmpField()
           
 CmpVersion getCmpVersion()
           
 java.lang.String getDescription()
           
 Text[] getDescriptions()
           
 java.lang.String getDisplayName()
           
 Text[] getDisplayNames()
           
 java.lang.String getEjbClass()
           
 java.util.Collection<EjbLocalRef> getEjbLocalRef()
           
 java.util.Map<java.lang.String,EjbLocalRef> getEjbLocalRefMap()
           
 java.lang.String getEjbName()
           
 java.util.Collection<EjbRef> getEjbRef()
           
 java.util.Map<java.lang.String,EjbRef> getEjbRefMap()
           
 java.util.Collection<EnvEntry> getEnvEntry()
           
 java.util.Map<java.lang.String,EnvEntry> getEnvEntryMap()
           
 java.lang.String getHome()
           
 Icon getIcon()
           
 java.util.Map<java.lang.String,Icon> getIconMap()
           
 java.util.Collection<Icon> getIcons()
           
 java.lang.String getId()
           
 java.lang.String getJndiConsumerName()
           
 java.lang.String getLocal()
           
 java.lang.String getLocalHome()
           
 java.lang.String getMappedName()
           
 java.util.Collection<MessageDestinationRef> getMessageDestinationRef()
           
 java.util.Map<java.lang.String,MessageDestinationRef> getMessageDestinationRefMap()
           
 java.util.Collection<PersistenceContextRef> getPersistenceContextRef()
           
 java.util.Map<java.lang.String,PersistenceContextRef> getPersistenceContextRefMap()
           
 PersistenceType getPersistenceType()
           
 java.util.Collection<PersistenceUnitRef> getPersistenceUnitRef()
           
 java.util.Map<java.lang.String,PersistenceUnitRef> getPersistenceUnitRefMap()
           
 java.util.List<LifecycleCallback> getPostConstruct()
           
 java.util.List<LifecycleCallback> getPreDestroy()
           
 java.lang.String getPrimKeyClass()
           
 java.lang.String getPrimkeyField()
           
 java.util.List<Query> getQuery()
           
 boolean getReentrant()
           
 java.lang.String getRemote()
           
 java.util.Collection<ResourceEnvRef> getResourceEnvRef()
           
 java.util.Map<java.lang.String,ResourceEnvRef> getResourceEnvRefMap()
           
 java.util.Collection<ResourceRef> getResourceRef()
           
 java.util.Map<java.lang.String,ResourceRef> getResourceRefMap()
           
 SecurityIdentity getSecurityIdentity()
           
 java.util.List<SecurityRoleRef> getSecurityRoleRef()
           
 java.util.Collection<ServiceRef> getServiceRef()
           
 java.util.Map<java.lang.String,ServiceRef> getServiceRefMap()
           
 TransactionType getTransactionType()
           
 void setAbstractSchemaName(java.lang.String value)
           
 void setCmpVersion(CmpVersion value)
           
 void setDescriptions(Text[] text)
           
 void setDisplayNames(Text[] text)
           
 void setEjbClass(java.lang.Class value)
           
 void setEjbClass(java.lang.String value)
           
 void setEjbName(java.lang.String value)
          The ejb-nameType specifies an enterprise bean's name.
 void setHome(java.lang.String value)
           
 void setId(java.lang.String value)
           
 void setLocal(java.lang.String value)
           
 void setLocalHome(java.lang.String value)
           
 void setMappedName(java.lang.String value)
           
 void setPersistenceType(PersistenceType value)
           
 void setPrimKeyClass(java.lang.String value)
           
 void setPrimkeyField(java.lang.String value)
           
 void setReentrant(boolean value)
           
 void setRemote(java.lang.String value)
           
 void setSecurityIdentity(SecurityIdentity value)
           
 void setTransactionType(TransactionType type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

description

protected TextMap description

displayName

protected TextMap displayName

icon

protected LocalCollection<Icon> icon

ejbName

protected java.lang.String ejbName

mappedName

protected java.lang.String mappedName

home

protected java.lang.String home

remote

protected java.lang.String remote

localHome

protected java.lang.String localHome

local

protected java.lang.String local

ejbClass

protected java.lang.String ejbClass

persistenceType

protected PersistenceType persistenceType

primKeyClass

protected java.lang.String primKeyClass

reentrant

protected boolean reentrant

cmpVersion

protected CmpVersion cmpVersion

abstractSchemaName

protected java.lang.String abstractSchemaName

cmpField

protected java.util.List<CmpField> cmpField

primkeyField

protected java.lang.String primkeyField

envEntry

protected KeyedCollection<java.lang.String,EnvEntry> envEntry

ejbRef

protected KeyedCollection<java.lang.String,EjbRef> ejbRef

ejbLocalRef

protected KeyedCollection<java.lang.String,EjbLocalRef> ejbLocalRef

serviceRef

protected KeyedCollection<java.lang.String,ServiceRef> serviceRef

resourceRef

protected KeyedCollection<java.lang.String,ResourceRef> resourceRef

resourceEnvRef

protected KeyedCollection<java.lang.String,ResourceEnvRef> resourceEnvRef

messageDestinationRef

protected KeyedCollection<java.lang.String,MessageDestinationRef> messageDestinationRef

persistenceContextRef

protected KeyedCollection<java.lang.String,PersistenceContextRef> persistenceContextRef

persistenceUnitRef

protected KeyedCollection<java.lang.String,PersistenceUnitRef> persistenceUnitRef

postConstruct

protected java.util.List<LifecycleCallback> postConstruct

preDestroy

protected java.util.List<LifecycleCallback> preDestroy

securityRoleRef

protected java.util.List<SecurityRoleRef> securityRoleRef

securityIdentity

protected SecurityIdentity securityIdentity

query

protected java.util.List<Query> query

id

protected java.lang.String id
Constructor Detail

EntityBean

public EntityBean()
Method Detail

getJndiConsumerName

public java.lang.String getJndiConsumerName()
Specified by:
getJndiConsumerName in interface JndiConsumer

getDescriptions

public Text[] getDescriptions()

setDescriptions

public void setDescriptions(Text[] text)

getDescription

public java.lang.String getDescription()

getDisplayNames

public Text[] getDisplayNames()

setDisplayNames

public void setDisplayNames(Text[] text)

getDisplayName

public java.lang.String getDisplayName()

getIcons

public java.util.Collection<Icon> getIcons()

getIconMap

public java.util.Map<java.lang.String,Icon> getIconMap()

getIcon

public Icon getIcon()

getEjbName

public java.lang.String getEjbName()
Specified by:
getEjbName in interface EnterpriseBean

setEjbName

public void setEjbName(java.lang.String value)
The ejb-nameType specifies an enterprise bean's name. It is used by ejb-name elements. This name is assigned by the ejb-jar file producer to name the enterprise bean in the ejb-jar file's deployment descriptor. The name must be unique among the names of the enterprise beans in the same ejb-jar file.

There is no architected relationship between the used ejb-name in the deployment descriptor and the JNDI name that the Deployer will assign to the enterprise bean's home.

The name for an entity bean must conform to the lexical rules for an NMTOKEN.

Example:

EmployeeService

Specified by:
setEjbName in interface EnterpriseBean

getMappedName

public java.lang.String getMappedName()
Specified by:
getMappedName in interface EnterpriseBean

setMappedName

public void setMappedName(java.lang.String value)
Specified by:
setMappedName in interface EnterpriseBean

getHome

public java.lang.String getHome()
Specified by:
getHome in interface RemoteBean

setHome

public void setHome(java.lang.String value)
Specified by:
setHome in interface RemoteBean

getRemote

public java.lang.String getRemote()
Specified by:
getRemote in interface RemoteBean

setRemote

public void setRemote(java.lang.String value)
Specified by:
setRemote in interface RemoteBean

getLocalHome

public java.lang.String getLocalHome()
Specified by:
getLocalHome in interface RemoteBean

setLocalHome

public void setLocalHome(java.lang.String value)
Specified by:
setLocalHome in interface RemoteBean

getLocal

public java.lang.String getLocal()
Specified by:
getLocal in interface RemoteBean

setLocal

public void setLocal(java.lang.String value)
Specified by:
setLocal in interface RemoteBean

getEjbClass

public java.lang.String getEjbClass()
Specified by:
getEjbClass in interface EnterpriseBean

setEjbClass

public void setEjbClass(java.lang.String value)
Specified by:
setEjbClass in interface EnterpriseBean

setEjbClass

public void setEjbClass(java.lang.Class value)
Specified by:
setEjbClass in interface EnterpriseBean

getPersistenceType

public PersistenceType getPersistenceType()

setPersistenceType

public void setPersistenceType(PersistenceType value)

getPrimKeyClass

public java.lang.String getPrimKeyClass()

setPrimKeyClass

public void setPrimKeyClass(java.lang.String value)

getReentrant

public boolean getReentrant()

setReentrant

public void setReentrant(boolean value)

getCmpVersion

public CmpVersion getCmpVersion()

setCmpVersion

public void setCmpVersion(CmpVersion value)

getAbstractSchemaName

public java.lang.String getAbstractSchemaName()

setAbstractSchemaName

public void setAbstractSchemaName(java.lang.String value)

getCmpField

public java.util.List<CmpField> getCmpField()

addCmpField

public void addCmpField(java.lang.String fieldName)

getPrimkeyField

public java.lang.String getPrimkeyField()

setPrimkeyField

public void setPrimkeyField(java.lang.String value)

getEnvEntry

public java.util.Collection<EnvEntry> getEnvEntry()
Specified by:
getEnvEntry in interface JndiConsumer

getEnvEntryMap

public java.util.Map<java.lang.String,EnvEntry> getEnvEntryMap()
Specified by:
getEnvEntryMap in interface JndiConsumer

getEjbRef

public java.util.Collection<EjbRef> getEjbRef()
Specified by:
getEjbRef in interface JndiConsumer

getEjbRefMap

public java.util.Map<java.lang.String,EjbRef> getEjbRefMap()
Specified by:
getEjbRefMap in interface JndiConsumer

getEjbLocalRef

public java.util.Collection<EjbLocalRef> getEjbLocalRef()
Specified by:
getEjbLocalRef in interface JndiConsumer

getEjbLocalRefMap

public java.util.Map<java.lang.String,EjbLocalRef> getEjbLocalRefMap()
Specified by:
getEjbLocalRefMap in interface JndiConsumer

getServiceRef

public java.util.Collection<ServiceRef> getServiceRef()
Specified by:
getServiceRef in interface JndiConsumer

getServiceRefMap

public java.util.Map<java.lang.String,ServiceRef> getServiceRefMap()
Specified by:
getServiceRefMap in interface JndiConsumer

getResourceRef

public java.util.Collection<ResourceRef> getResourceRef()
Specified by:
getResourceRef in interface JndiConsumer

getResourceRefMap

public java.util.Map<java.lang.String,ResourceRef> getResourceRefMap()
Specified by:
getResourceRefMap in interface JndiConsumer

getResourceEnvRef

public java.util.Collection<ResourceEnvRef> getResourceEnvRef()
Specified by:
getResourceEnvRef in interface JndiConsumer

getResourceEnvRefMap

public java.util.Map<java.lang.String,ResourceEnvRef> getResourceEnvRefMap()
Specified by:
getResourceEnvRefMap in interface JndiConsumer

getMessageDestinationRef

public java.util.Collection<MessageDestinationRef> getMessageDestinationRef()
Specified by:
getMessageDestinationRef in interface JndiConsumer

getMessageDestinationRefMap

public java.util.Map<java.lang.String,MessageDestinationRef> getMessageDestinationRefMap()
Specified by:
getMessageDestinationRefMap in interface JndiConsumer

getPersistenceContextRef

public java.util.Collection<PersistenceContextRef> getPersistenceContextRef()
Specified by:
getPersistenceContextRef in interface JndiConsumer

getPersistenceContextRefMap

public java.util.Map<java.lang.String,PersistenceContextRef> getPersistenceContextRefMap()
Specified by:
getPersistenceContextRefMap in interface JndiConsumer

getPersistenceUnitRef

public java.util.Collection<PersistenceUnitRef> getPersistenceUnitRef()
Specified by:
getPersistenceUnitRef in interface JndiConsumer

getPersistenceUnitRefMap

public java.util.Map<java.lang.String,PersistenceUnitRef> getPersistenceUnitRefMap()
Specified by:
getPersistenceUnitRefMap in interface JndiConsumer

getPostConstruct

public java.util.List<LifecycleCallback> getPostConstruct()
Specified by:
getPostConstruct in interface Lifecycle

addPostConstruct

public void addPostConstruct(java.lang.String method)
Specified by:
addPostConstruct in interface Lifecycle

getPreDestroy

public java.util.List<LifecycleCallback> getPreDestroy()
Specified by:
getPreDestroy in interface Lifecycle

addPreDestroy

public void addPreDestroy(java.lang.String method)
Specified by:
addPreDestroy in interface Lifecycle

getSecurityRoleRef

public java.util.List<SecurityRoleRef> getSecurityRoleRef()
Specified by:
getSecurityRoleRef in interface EnterpriseBean

getBusinessLocal

public java.util.Collection<java.lang.String> getBusinessLocal()
Specified by:
getBusinessLocal in interface RemoteBean

getBusinessRemote

public java.util.Collection<java.lang.String> getBusinessRemote()
Specified by:
getBusinessRemote in interface RemoteBean

getSecurityIdentity

public SecurityIdentity getSecurityIdentity()
Specified by:
getSecurityIdentity in interface EnterpriseBean

setSecurityIdentity

public void setSecurityIdentity(SecurityIdentity value)
Specified by:
setSecurityIdentity in interface EnterpriseBean

getQuery

public java.util.List<Query> getQuery()

getId

public java.lang.String getId()
Specified by:
getId in interface EnterpriseBean

setId

public void setId(java.lang.String value)
Specified by:
setId in interface EnterpriseBean

getAroundInvoke

public java.util.List<AroundInvoke> getAroundInvoke()
Specified by:
getAroundInvoke in interface Lifecycle

addAroundInvoke

public void addAroundInvoke(java.lang.String method)
Specified by:
addAroundInvoke in interface Lifecycle

getTransactionType

public TransactionType getTransactionType()
Specified by:
getTransactionType in interface EnterpriseBean

setTransactionType

public void setTransactionType(TransactionType type)
Specified by:
setTransactionType in interface EnterpriseBean


Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.