Package org.apache.openejb.jee.jpa
Class Entity
- java.lang.Object
-
- org.apache.openejb.jee.jpa.Entity
-
public class Entity extends Object implements Mapping, Keyable<String>
Defines the settings and mappings for an entity. Is allowed to be sparsely populated and used in conjunction with the annotations. Alternatively, the metadata-complete attribute can be used to indicate that no annotations on the entity class (and its fields or properties) are to be processed. If this is the case then the defaulting rules for the entity and its subelements will be recursively applied. Target(TYPE) @Retention(RUNTIME) public @interface Entity { String name() default ""; }Java class for entity complex type.
The following schema fragment specifies the expected content contained within this class.
<complexType name="entity"> <complexContent> <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> <element name="table" type="{http://java.sun.com/xml/ns/persistence/orm}table" minOccurs="0"/> <element name="secondary-table" type="{http://java.sun.com/xml/ns/persistence/orm}secondary-table" maxOccurs="unbounded" minOccurs="0"/> <element name="primary-key-join-column" type="{http://java.sun.com/xml/ns/persistence/orm}primary-key-join-column" maxOccurs="unbounded" minOccurs="0"/> <element name="id-class" type="{http://java.sun.com/xml/ns/persistence/orm}id-class" minOccurs="0"/> <element name="inheritance" type="{http://java.sun.com/xml/ns/persistence/orm}inheritance" minOccurs="0"/> <element name="discriminator-value" type="{http://java.sun.com/xml/ns/persistence/orm}discriminator-value" minOccurs="0"/> <element name="discriminator-column" type="{http://java.sun.com/xml/ns/persistence/orm}discriminator-column" minOccurs="0"/> <element name="sequence-generator" type="{http://java.sun.com/xml/ns/persistence/orm}sequence-generator" minOccurs="0"/> <element name="table-generator" type="{http://java.sun.com/xml/ns/persistence/orm}table-generator" minOccurs="0"/> <element name="named-query" type="{http://java.sun.com/xml/ns/persistence/orm}named-query" maxOccurs="unbounded" minOccurs="0"/> <element name="named-native-query" type="{http://java.sun.com/xml/ns/persistence/orm}named-native-query" maxOccurs="unbounded" minOccurs="0"/> <element name="sql-result-set-mapping" type="{http://java.sun.com/xml/ns/persistence/orm}sql-result-set-mapping" maxOccurs="unbounded" minOccurs="0"/> <element name="exclude-default-listeners" type="{http://java.sun.com/xml/ns/persistence/orm}emptyType" minOccurs="0"/> <element name="exclude-superclass-listeners" type="{http://java.sun.com/xml/ns/persistence/orm}emptyType" minOccurs="0"/> <element name="entity-listeners" type="{http://java.sun.com/xml/ns/persistence/orm}entity-listeners" minOccurs="0"/> <element name="pre-persist" type="{http://java.sun.com/xml/ns/persistence/orm}pre-persist" minOccurs="0"/> <element name="post-persist" type="{http://java.sun.com/xml/ns/persistence/orm}post-persist" minOccurs="0"/> <element name="pre-remove" type="{http://java.sun.com/xml/ns/persistence/orm}pre-remove" minOccurs="0"/> <element name="post-remove" type="{http://java.sun.com/xml/ns/persistence/orm}post-remove" minOccurs="0"/> <element name="pre-update" type="{http://java.sun.com/xml/ns/persistence/orm}pre-update" minOccurs="0"/> <element name="post-update" type="{http://java.sun.com/xml/ns/persistence/orm}post-update" minOccurs="0"/> <element name="post-load" type="{http://java.sun.com/xml/ns/persistence/orm}post-load" minOccurs="0"/> <element name="attribute-override" type="{http://java.sun.com/xml/ns/persistence/orm}attribute-override" maxOccurs="unbounded" minOccurs="0"/> <element name="association-override" type="{http://java.sun.com/xml/ns/persistence/orm}association-override" maxOccurs="unbounded" minOccurs="0"/> <element name="attributes" type="{http://java.sun.com/xml/ns/persistence/orm}attributes" minOccurs="0"/> </sequence> <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" /> <attribute name="class" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> <attribute name="access" type="{http://java.sun.com/xml/ns/persistence/orm}access-type" /> <attribute name="cacheable" type="{http://www.w3.org/2001/XMLSchema}boolean" /> <attribute name="metadata-complete" type="{http://www.w3.org/2001/XMLSchema}boolean" /> </restriction> </complexContent> </complexType>
-
-
Field Summary
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddField(Field field)AccessTypegetAccess()Gets the value of the access property.List<AssociationOverride>getAssociationOverride()Gets the value of the associationOverride property.List<AttributeOverride>getAttributeOverride()Gets the value of the attributeOverride property.AttributesgetAttributes()Gets the value of the attributes property.StringgetClazz()Gets the value of the clazz property.StringgetDescription()Gets the value of the description property.DiscriminatorColumngetDiscriminatorColumn()Gets the value of the discriminatorColumn property.StringgetDiscriminatorValue()Gets the value of the discriminatorValue property.StringgetEjbName()EntityListenersgetEntityListeners()Gets the value of the entityListeners property.IdClassgetIdClass()Gets the value of the idClass property.InheritancegetInheritance()Gets the value of the inheritance property.StringgetKey()Gets the immutable key for this object.StringgetName()Gets the value of the name property.List<NamedNativeQuery>getNamedNativeQuery()Gets the value of the namedNativeQuery property.List<NamedQuery>getNamedQuery()Gets the value of the namedQuery property.PostLoadgetPostLoad()Gets the value of the postLoad property.PostPersistgetPostPersist()Gets the value of the postPersist property.PostRemovegetPostRemove()Gets the value of the postRemove property.PostUpdategetPostUpdate()Gets the value of the postUpdate property.PrePersistgetPrePersist()Gets the value of the prePersist property.PreRemovegetPreRemove()Gets the value of the preRemove property.PreUpdategetPreUpdate()Gets the value of the preUpdate property.List<PrimaryKeyJoinColumn>getPrimaryKeyJoinColumn()Gets the value of the primaryKeyJoinColumn property.List<SecondaryTable>getSecondaryTable()Gets the value of the secondaryTable property.SequenceGeneratorgetSequenceGenerator()Gets the value of the sequenceGenerator property.List<SqlResultSetMapping>getSqlResultSetMapping()Gets the value of the sqlResultSetMapping property.TablegetTable()Gets the value of the table property.TableGeneratorgetTableGenerator()Gets the value of the tableGenerator property.BooleanisCacheable()Gets the value of the cacheable property.booleanisExcludeDefaultListeners()Gets the value of the excludeDefaultListeners property.booleanisExcludeSuperclassListeners()Gets the value of the excludeSuperclassListeners property.BooleanisMetadataComplete()Gets the value of the metadataComplete property.booleanisXmlMetadataComplete()voidsetAccess(AccessType value)Sets the value of the access property.voidsetAttributes(Attributes value)Sets the value of the attributes property.voidsetCacheable(Boolean value)Sets the value of the cacheable property.voidsetClazz(String value)Sets the value of the clazz property.voidsetDescription(String value)Sets the value of the description property.voidsetDiscriminatorColumn(DiscriminatorColumn value)Sets the value of the discriminatorColumn property.voidsetDiscriminatorValue(String value)Sets the value of the discriminatorValue property.voidsetEjbName(String ejbName)voidsetEntityListeners(EntityListeners value)Sets the value of the entityListeners property.voidsetExcludeDefaultListeners(boolean value)Sets the value of the excludeDefaultListeners property.voidsetExcludeSuperclassListeners(boolean value)Sets the value of the excludeSuperclassListeners property.voidsetIdClass(IdClass value)Sets the value of the idClass property.voidsetInheritance(Inheritance value)Sets the value of the inheritance property.voidsetMetadataComplete(Boolean value)Sets the value of the metadataComplete property.voidsetName(String value)Sets the value of the name property.voidsetPostLoad(PostLoad value)Sets the value of the postLoad property.voidsetPostPersist(PostPersist value)Sets the value of the postPersist property.voidsetPostRemove(PostRemove value)Sets the value of the postRemove property.voidsetPostUpdate(PostUpdate value)Sets the value of the postUpdate property.voidsetPrePersist(PrePersist value)Sets the value of the prePersist property.voidsetPreRemove(PreRemove value)Sets the value of the preRemove property.voidsetPreUpdate(PreUpdate value)Sets the value of the preUpdate property.voidsetSequenceGenerator(SequenceGenerator value)Sets the value of the sequenceGenerator property.voidsetTable(Table value)Sets the value of the table property.voidsetTableGenerator(TableGenerator value)Sets the value of the tableGenerator property.voidsetXmlMetadataComplete(boolean xmlMetadataComplete)
-
-
-
Field Detail
-
description
protected String description
-
table
protected Table table
-
secondaryTable
protected List<SecondaryTable> secondaryTable
-
primaryKeyJoinColumn
protected List<PrimaryKeyJoinColumn> primaryKeyJoinColumn
-
idClass
protected IdClass idClass
-
inheritance
protected Inheritance inheritance
-
discriminatorValue
protected String discriminatorValue
-
discriminatorColumn
protected DiscriminatorColumn discriminatorColumn
-
sequenceGenerator
protected SequenceGenerator sequenceGenerator
-
tableGenerator
protected TableGenerator tableGenerator
-
namedQuery
protected List<NamedQuery> namedQuery
-
namedNativeQuery
protected List<NamedNativeQuery> namedNativeQuery
-
sqlResultSetMapping
protected List<SqlResultSetMapping> sqlResultSetMapping
-
excludeDefaultListeners
protected EmptyType excludeDefaultListeners
-
excludeSuperclassListeners
protected EmptyType excludeSuperclassListeners
-
entityListeners
protected EntityListeners entityListeners
-
prePersist
protected PrePersist prePersist
-
postPersist
protected PostPersist postPersist
-
preRemove
protected PreRemove preRemove
-
postRemove
protected PostRemove postRemove
-
preUpdate
protected PreUpdate preUpdate
-
postUpdate
protected PostUpdate postUpdate
-
postLoad
protected PostLoad postLoad
-
attributeOverride
protected List<AttributeOverride> attributeOverride
-
associationOverride
protected List<AssociationOverride> associationOverride
-
attributes
protected Attributes attributes
-
access
protected AccessType access
-
clazz
protected String clazz
-
cacheable
protected Boolean cacheable
-
metadataComplete
protected Boolean metadataComplete
-
name
protected String name
-
ejbName
protected String ejbName
-
xmlMetadataComplete
protected boolean xmlMetadataComplete
-
-
Constructor Detail
-
Entity
public Entity()
-
Entity
public Entity(String clazz)
-
-
Method Detail
-
getDescription
public String getDescription()
Gets the value of the description property.- Specified by:
getDescriptionin interfaceMapping- Returns:
- possible object is
String
-
setDescription
public void setDescription(String value)
Sets the value of the description property.- Specified by:
setDescriptionin interfaceMapping- Parameters:
value- allowed object isString
-
getTable
public Table getTable()
Gets the value of the table property.- Returns:
- possible object is
Table
-
setTable
public void setTable(Table value)
Sets the value of the table property.- Parameters:
value- allowed object isTable
-
getSecondaryTable
public List<SecondaryTable> getSecondaryTable()
Gets the value of the secondaryTable property. This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not asetmethod for the secondaryTable property. For example, to add a new item, do as follows:getSecondaryTable().add(newItem);Objects of the following type(s) are allowed in the listSecondaryTable
-
getPrimaryKeyJoinColumn
public List<PrimaryKeyJoinColumn> getPrimaryKeyJoinColumn()
Gets the value of the primaryKeyJoinColumn property. This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not asetmethod for the primaryKeyJoinColumn property. For example, to add a new item, do as follows:getPrimaryKeyJoinColumn().add(newItem);Objects of the following type(s) are allowed in the listPrimaryKeyJoinColumn
-
getIdClass
public IdClass getIdClass()
Gets the value of the idClass property.- Specified by:
getIdClassin interfaceMapping- Returns:
- possible object is
IdClass
-
setIdClass
public void setIdClass(IdClass value)
Sets the value of the idClass property.- Specified by:
setIdClassin interfaceMapping- Parameters:
value- allowed object isIdClass
-
getInheritance
public Inheritance getInheritance()
Gets the value of the inheritance property.- Returns:
- possible object is
Inheritance
-
setInheritance
public void setInheritance(Inheritance value)
Sets the value of the inheritance property.- Parameters:
value- allowed object isInheritance
-
getDiscriminatorValue
public String getDiscriminatorValue()
Gets the value of the discriminatorValue property.- Returns:
- possible object is
String
-
setDiscriminatorValue
public void setDiscriminatorValue(String value)
Sets the value of the discriminatorValue property.- Parameters:
value- allowed object isString
-
getDiscriminatorColumn
public DiscriminatorColumn getDiscriminatorColumn()
Gets the value of the discriminatorColumn property.- Returns:
- possible object is
DiscriminatorColumn
-
setDiscriminatorColumn
public void setDiscriminatorColumn(DiscriminatorColumn value)
Sets the value of the discriminatorColumn property.- Parameters:
value- allowed object isDiscriminatorColumn
-
getSequenceGenerator
public SequenceGenerator getSequenceGenerator()
Gets the value of the sequenceGenerator property.- Returns:
- possible object is
SequenceGenerator
-
setSequenceGenerator
public void setSequenceGenerator(SequenceGenerator value)
Sets the value of the sequenceGenerator property.- Parameters:
value- allowed object isSequenceGenerator
-
getTableGenerator
public TableGenerator getTableGenerator()
Gets the value of the tableGenerator property.- Returns:
- possible object is
TableGenerator
-
setTableGenerator
public void setTableGenerator(TableGenerator value)
Sets the value of the tableGenerator property.- Parameters:
value- allowed object isTableGenerator
-
getNamedQuery
public List<NamedQuery> getNamedQuery()
Gets the value of the namedQuery property. This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not asetmethod for the namedQuery property. For example, to add a new item, do as follows:getNamedQuery().add(newItem);Objects of the following type(s) are allowed in the listNamedQuery
-
getNamedNativeQuery
public List<NamedNativeQuery> getNamedNativeQuery()
Gets the value of the namedNativeQuery property. This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not asetmethod for the namedNativeQuery property. For example, to add a new item, do as follows:getNamedNativeQuery().add(newItem);Objects of the following type(s) are allowed in the listNamedNativeQuery
-
getSqlResultSetMapping
public List<SqlResultSetMapping> getSqlResultSetMapping()
Gets the value of the sqlResultSetMapping property. This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not asetmethod for the sqlResultSetMapping property. For example, to add a new item, do as follows:getSqlResultSetMapping().add(newItem);Objects of the following type(s) are allowed in the listSqlResultSetMapping
-
isExcludeDefaultListeners
public boolean isExcludeDefaultListeners()
Gets the value of the excludeDefaultListeners property.- Specified by:
isExcludeDefaultListenersin interfaceMapping- Returns:
- possible object is
boolean
-
setExcludeDefaultListeners
public void setExcludeDefaultListeners(boolean value)
Sets the value of the excludeDefaultListeners property.- Specified by:
setExcludeDefaultListenersin interfaceMapping- Parameters:
value- allowed object isboolean
-
isExcludeSuperclassListeners
public boolean isExcludeSuperclassListeners()
Gets the value of the excludeSuperclassListeners property.- Specified by:
isExcludeSuperclassListenersin interfaceMapping- Returns:
- possible object is
boolean
-
setExcludeSuperclassListeners
public void setExcludeSuperclassListeners(boolean value)
Sets the value of the excludeSuperclassListeners property.- Specified by:
setExcludeSuperclassListenersin interfaceMapping- Parameters:
value- allowed object isboolean
-
getEntityListeners
public EntityListeners getEntityListeners()
Gets the value of the entityListeners property.- Specified by:
getEntityListenersin interfaceMapping- Returns:
- possible object is
EntityListeners
-
setEntityListeners
public void setEntityListeners(EntityListeners value)
Sets the value of the entityListeners property.- Specified by:
setEntityListenersin interfaceMapping- Parameters:
value- allowed object isEntityListeners
-
getPrePersist
public PrePersist getPrePersist()
Gets the value of the prePersist property.- Specified by:
getPrePersistin interfaceMapping- Returns:
- possible object is
PrePersist
-
setPrePersist
public void setPrePersist(PrePersist value)
Sets the value of the prePersist property.- Specified by:
setPrePersistin interfaceMapping- Parameters:
value- allowed object isPrePersist
-
getPostPersist
public PostPersist getPostPersist()
Gets the value of the postPersist property.- Specified by:
getPostPersistin interfaceMapping- Returns:
- possible object is
PostPersist
-
setPostPersist
public void setPostPersist(PostPersist value)
Sets the value of the postPersist property.- Specified by:
setPostPersistin interfaceMapping- Parameters:
value- allowed object isPostPersist
-
getPreRemove
public PreRemove getPreRemove()
Gets the value of the preRemove property.- Specified by:
getPreRemovein interfaceMapping- Returns:
- possible object is
PreRemove
-
setPreRemove
public void setPreRemove(PreRemove value)
Sets the value of the preRemove property.- Specified by:
setPreRemovein interfaceMapping- Parameters:
value- allowed object isPreRemove
-
getPostRemove
public PostRemove getPostRemove()
Gets the value of the postRemove property.- Specified by:
getPostRemovein interfaceMapping- Returns:
- possible object is
PostRemove
-
setPostRemove
public void setPostRemove(PostRemove value)
Sets the value of the postRemove property.- Specified by:
setPostRemovein interfaceMapping- Parameters:
value- allowed object isPostRemove
-
getPreUpdate
public PreUpdate getPreUpdate()
Gets the value of the preUpdate property.- Specified by:
getPreUpdatein interfaceMapping- Returns:
- possible object is
PreUpdate
-
setPreUpdate
public void setPreUpdate(PreUpdate value)
Sets the value of the preUpdate property.- Specified by:
setPreUpdatein interfaceMapping- Parameters:
value- allowed object isPreUpdate
-
getPostUpdate
public PostUpdate getPostUpdate()
Gets the value of the postUpdate property.- Specified by:
getPostUpdatein interfaceMapping- Returns:
- possible object is
PostUpdate
-
setPostUpdate
public void setPostUpdate(PostUpdate value)
Sets the value of the postUpdate property.- Specified by:
setPostUpdatein interfaceMapping- Parameters:
value- allowed object isPostUpdate
-
getPostLoad
public PostLoad getPostLoad()
Gets the value of the postLoad property.- Specified by:
getPostLoadin interfaceMapping- Returns:
- possible object is
PostLoad
-
setPostLoad
public void setPostLoad(PostLoad value)
Sets the value of the postLoad property.- Specified by:
setPostLoadin interfaceMapping- Parameters:
value- allowed object isPostLoad
-
getAttributeOverride
public List<AttributeOverride> getAttributeOverride()
Gets the value of the attributeOverride property. This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not asetmethod for the attributeOverride property. For example, to add a new item, do as follows:getAttributeOverride().add(newItem);Objects of the following type(s) are allowed in the listAttributeOverride
-
getAssociationOverride
public List<AssociationOverride> getAssociationOverride()
Gets the value of the associationOverride property. This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not asetmethod for the associationOverride property. For example, to add a new item, do as follows:getAssociationOverride().add(newItem);Objects of the following type(s) are allowed in the listAssociationOverride
-
getAttributes
public Attributes getAttributes()
Gets the value of the attributes property.- Specified by:
getAttributesin interfaceMapping- Returns:
- possible object is
Attributes
-
setAttributes
public void setAttributes(Attributes value)
Sets the value of the attributes property.- Specified by:
setAttributesin interfaceMapping- Parameters:
value- allowed object isAttributes
-
getAccess
public AccessType getAccess()
Gets the value of the access property.- Specified by:
getAccessin interfaceMapping- Returns:
- possible object is
AccessType
-
setAccess
public void setAccess(AccessType value)
Sets the value of the access property.- Specified by:
setAccessin interfaceMapping- Parameters:
value- allowed object isAccessType
-
getClazz
public String getClazz()
Gets the value of the clazz property.
-
setClazz
public void setClazz(String value)
Sets the value of the clazz property.
-
isCacheable
public Boolean isCacheable()
Gets the value of the cacheable property.- Returns:
- possible object is
Boolean
-
setCacheable
public void setCacheable(Boolean value)
Sets the value of the cacheable property.- Parameters:
value- allowed object isBoolean
-
isMetadataComplete
public Boolean isMetadataComplete()
Gets the value of the metadataComplete property.- Specified by:
isMetadataCompletein interfaceMapping- Returns:
- possible object is
Boolean
-
setMetadataComplete
public void setMetadataComplete(Boolean value)
Sets the value of the metadataComplete property.- Specified by:
setMetadataCompletein interfaceMapping- Parameters:
value- allowed object isBoolean
-
getName
public String getName()
Gets the value of the name property.- Returns:
- possible object is
String
-
setName
public void setName(String value)
Sets the value of the name property.- Parameters:
value- allowed object isString
-
getEjbName
public String getEjbName()
-
setEjbName
public void setEjbName(String ejbName)
-
isXmlMetadataComplete
public boolean isXmlMetadataComplete()
-
setXmlMetadataComplete
public void setXmlMetadataComplete(boolean xmlMetadataComplete)
-
-