Package org.apache.openejb.jee.jpa
Class OneToMany
- java.lang.Object
-
- org.apache.openejb.jee.jpa.OneToMany
-
- All Implemented Interfaces:
RelationField,Keyable
public class OneToMany extends Object implements RelationField
Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface OneToMany { Class targetEntity() default void.class; CascadeType[] cascade() default {}; FetchType fetch() default LAZY; String mappedBy() default ""; }Java class for one-to-many complex type.
The following schema fragment specifies the expected content contained within this class.
<complexType name="one-to-many"> <complexContent> <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> <choice> <element name="order-by" type="{http://java.sun.com/xml/ns/persistence/orm}order-by" minOccurs="0"/> <element name="order-column" type="{http://java.sun.com/xml/ns/persistence/orm}order-column" minOccurs="0"/> </choice> <choice> <element name="map-key" type="{http://java.sun.com/xml/ns/persistence/orm}map-key" minOccurs="0"/> <sequence> <element name="map-key-class" type="{http://java.sun.com/xml/ns/persistence/orm}map-key-class" minOccurs="0"/> <choice> <element name="map-key-temporal" type="{http://java.sun.com/xml/ns/persistence/orm}temporal" minOccurs="0"/> <element name="map-key-enumerated" type="{http://java.sun.com/xml/ns/persistence/orm}enumerated" minOccurs="0"/> <element name="map-key-attribute-override" type="{http://java.sun.com/xml/ns/persistence/orm}attribute-override" maxOccurs="unbounded" minOccurs="0"/> </choice> <choice> <element name="map-key-column" type="{http://java.sun.com/xml/ns/persistence/orm}map-key-column" minOccurs="0"/> <element name="map-key-join-column" type="{http://java.sun.com/xml/ns/persistence/orm}map-key-join-column" maxOccurs="unbounded" minOccurs="0"/> </choice> </sequence> </choice> <choice> <element name="join-table" type="{http://java.sun.com/xml/ns/persistence/orm}join-table" minOccurs="0"/> <element name="join-column" type="{http://java.sun.com/xml/ns/persistence/orm}join-column" maxOccurs="unbounded" minOccurs="0"/> </choice> <element name="cascade" type="{http://java.sun.com/xml/ns/persistence/orm}cascade-type" minOccurs="0"/> </sequence> <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> <attribute name="target-entity" type="{http://www.w3.org/2001/XMLSchema}string" /> <attribute name="fetch" type="{http://java.sun.com/xml/ns/persistence/orm}fetch-type" /> <attribute name="access" type="{http://java.sun.com/xml/ns/persistence/orm}access-type" /> <attribute name="mapped-by" type="{http://www.w3.org/2001/XMLSchema}string" /> <attribute name="orphan-removal" type="{http://www.w3.org/2001/XMLSchema}boolean" /> </restriction> </complexContent> </complexType>
-
-
Field Summary
Fields Modifier and Type Field Description protected CascadeTypecascadeprotected FetchTypefetchprotected List<JoinColumn>joinColumnprotected JoinTablejoinTableprotected MapKeymapKeyprotected List<AttributeOverride>mapKeyAttributeOverrideprotected MapKeyClassmapKeyClassprotected MapKeyColumnmapKeyColumnprotected EnumTypemapKeyEnumeratedprotected List<MapKeyJoinColumn>mapKeyJoinColumnprotected TemporalTypemapKeyTemporalprotected StringmappedByprotected Stringnameprotected StringorderByprotected OrderColumnorderColumnprotected BooleanorphanRemovalprotected RelationFieldrelatedFieldprotected booleansyntheticFieldprotected StringtargetEntity
-
Constructor Summary
Constructors Constructor Description OneToMany()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CascadeTypegetCascade()Gets the value of the cascade property.FetchTypegetFetch()Gets the value of the fetch property.List<JoinColumn>getJoinColumn()Gets the value of the joinColumn property.JoinTablegetJoinTable()Gets the value of the joinTable property.ObjectgetKey()Gets the immutable key for this object.MapKeygetMapKey()Gets the value of the mapKey property.List<AttributeOverride>getMapKeyAttributeOverride()Gets the value of the mapKeyAttributeOverride property.MapKeyClassgetMapKeyClass()Gets the value of the mapKeyClass property.MapKeyColumngetMapKeyColumn()Gets the value of the mapKeyColumn property.EnumTypegetMapKeyEnumerated()Gets the value of the mapKeyEnumerated property.List<MapKeyJoinColumn>getMapKeyJoinColumn()Gets the value of the mapKeyJoinColumn property.TemporalTypegetMapKeyTemporal()Gets the value of the mapKeyTemporal property.StringgetMappedBy()Gets the value of the mappedBy property.StringgetName()Gets the value of the name property.StringgetOrderBy()Gets the value of the orderBy property.OrderColumngetOrderColumn()Gets the value of the orderColumn property.RelationFieldgetRelatedField()This is only used for xml converters and will normally return null.StringgetTargetEntity()Gets the value of the targetEntity property.BooleanisOrphanRemoval()Gets the value of the orphanRemoval property.booleanisSyntheticField()This is only used for xml converters and will normally return false.voidsetCascade(CascadeType value)Sets the value of the cascade property.voidsetFetch(FetchType value)Sets the value of the fetch property.voidsetJoinTable(JoinTable value)Sets the value of the joinTable property.voidsetMapKey(MapKey value)Sets the value of the mapKey property.voidsetMapKeyClass(MapKeyClass value)Sets the value of the mapKeyClass property.voidsetMapKeyColumn(MapKeyColumn value)Sets the value of the mapKeyColumn property.voidsetMapKeyEnumerated(EnumType value)Sets the value of the mapKeyEnumerated property.voidsetMapKeyTemporal(TemporalType value)Sets the value of the mapKeyTemporal property.voidsetMappedBy(String value)Sets the value of the mappedBy property.voidsetName(String value)Sets the value of the name property.voidsetOrderBy(String value)Sets the value of the orderBy property.voidsetOrderColumn(OrderColumn value)Sets the value of the orderColumn property.voidsetOrphanRemoval(Boolean value)Sets the value of the orphanRemoval property.voidsetRelatedField(RelationField value)Gets the field on the target entity for this relationship.voidsetSyntheticField(boolean syntheticField)This is only used for xml converters and will normally return false.voidsetTargetEntity(String value)Sets the value of the targetEntity property.
-
-
-
Field Detail
-
orderBy
protected String orderBy
-
orderColumn
protected OrderColumn orderColumn
-
mapKey
protected MapKey mapKey
-
mapKeyClass
protected MapKeyClass mapKeyClass
-
mapKeyTemporal
protected TemporalType mapKeyTemporal
-
mapKeyEnumerated
protected EnumType mapKeyEnumerated
-
mapKeyAttributeOverride
protected List<AttributeOverride> mapKeyAttributeOverride
-
mapKeyColumn
protected MapKeyColumn mapKeyColumn
-
mapKeyJoinColumn
protected List<MapKeyJoinColumn> mapKeyJoinColumn
-
joinTable
protected JoinTable joinTable
-
joinColumn
protected List<JoinColumn> joinColumn
-
cascade
protected CascadeType cascade
-
fetch
protected FetchType fetch
-
mappedBy
protected String mappedBy
-
orphanRemoval
protected Boolean orphanRemoval
-
name
protected String name
-
targetEntity
protected String targetEntity
-
relatedField
protected RelationField relatedField
-
syntheticField
protected boolean syntheticField
-
-
Method Detail
-
getOrderBy
public String getOrderBy()
Gets the value of the orderBy property.- Returns:
- possible object is
String
-
setOrderBy
public void setOrderBy(String value)
Sets the value of the orderBy property.- Parameters:
value- allowed object isString
-
getOrderColumn
public OrderColumn getOrderColumn()
Gets the value of the orderColumn property.- Returns:
- possible object is
OrderColumn
-
setOrderColumn
public void setOrderColumn(OrderColumn value)
Sets the value of the orderColumn property.- Parameters:
value- allowed object isOrderColumn
-
getMapKey
public MapKey getMapKey()
Gets the value of the mapKey property.- Returns:
- possible object is
MapKey
-
setMapKey
public void setMapKey(MapKey value)
Sets the value of the mapKey property.- Parameters:
value- allowed object isMapKey
-
getMapKeyClass
public MapKeyClass getMapKeyClass()
Gets the value of the mapKeyClass property.- Returns:
- possible object is
MapKeyClass
-
setMapKeyClass
public void setMapKeyClass(MapKeyClass value)
Sets the value of the mapKeyClass property.- Parameters:
value- allowed object isMapKeyClass
-
getMapKeyTemporal
public TemporalType getMapKeyTemporal()
Gets the value of the mapKeyTemporal property.- Returns:
- possible object is
TemporalType
-
setMapKeyTemporal
public void setMapKeyTemporal(TemporalType value)
Sets the value of the mapKeyTemporal property.- Parameters:
value- allowed object isTemporalType
-
getMapKeyEnumerated
public EnumType getMapKeyEnumerated()
Gets the value of the mapKeyEnumerated property.- Returns:
- possible object is
EnumType
-
setMapKeyEnumerated
public void setMapKeyEnumerated(EnumType value)
Sets the value of the mapKeyEnumerated property.- Parameters:
value- allowed object isEnumType
-
getMapKeyAttributeOverride
public List<AttributeOverride> getMapKeyAttributeOverride()
Gets the value of the mapKeyAttributeOverride 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 mapKeyAttributeOverride property. For example, to add a new item, do as follows:getMapKeyAttributeOverride().add(newItem);Objects of the following type(s) are allowed in the listAttributeOverride
-
getMapKeyColumn
public MapKeyColumn getMapKeyColumn()
Gets the value of the mapKeyColumn property.- Returns:
- possible object is
MapKeyColumn
-
setMapKeyColumn
public void setMapKeyColumn(MapKeyColumn value)
Sets the value of the mapKeyColumn property.- Parameters:
value- allowed object isMapKeyColumn
-
getMapKeyJoinColumn
public List<MapKeyJoinColumn> getMapKeyJoinColumn()
Gets the value of the mapKeyJoinColumn 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 mapKeyJoinColumn property. For example, to add a new item, do as follows:getMapKeyJoinColumn().add(newItem);Objects of the following type(s) are allowed in the listMapKeyJoinColumn
-
getJoinTable
public JoinTable getJoinTable()
Gets the value of the joinTable property.- Specified by:
getJoinTablein interfaceRelationField- Returns:
- possible object is
JoinTable
-
setJoinTable
public void setJoinTable(JoinTable value)
Sets the value of the joinTable property.- Specified by:
setJoinTablein interfaceRelationField- Parameters:
value- allowed object isJoinTable
-
getJoinColumn
public List<JoinColumn> getJoinColumn()
Gets the value of the joinColumn 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 joinColumn property. For example, to add a new item, do as follows:getJoinColumn().add(newItem);Objects of the following type(s) are allowed in the listJoinColumn- Specified by:
getJoinColumnin interfaceRelationField
-
getCascade
public CascadeType getCascade()
Gets the value of the cascade property.- Specified by:
getCascadein interfaceRelationField- Returns:
- possible object is
CascadeType
-
setCascade
public void setCascade(CascadeType value)
Sets the value of the cascade property.- Specified by:
setCascadein interfaceRelationField- Parameters:
value- allowed object isCascadeType
-
getFetch
public FetchType getFetch()
Gets the value of the fetch property.- Specified by:
getFetchin interfaceRelationField- Returns:
- possible object is
FetchType
-
setFetch
public void setFetch(FetchType value)
Sets the value of the fetch property.- Specified by:
setFetchin interfaceRelationField- Parameters:
value- allowed object isFetchType
-
getMappedBy
public String getMappedBy()
Gets the value of the mappedBy property.- Specified by:
getMappedByin interfaceRelationField- Returns:
- possible object is
String
-
setMappedBy
public void setMappedBy(String value)
Sets the value of the mappedBy property.- Specified by:
setMappedByin interfaceRelationField- Parameters:
value- allowed object isString
-
getName
public String getName()
Gets the value of the name property.- Specified by:
getNamein interfaceRelationField- Returns:
- possible object is
String
-
setName
public void setName(String value)
Sets the value of the name property.- Specified by:
setNamein interfaceRelationField- Parameters:
value- allowed object isString
-
getTargetEntity
public String getTargetEntity()
Gets the value of the targetEntity property.- Specified by:
getTargetEntityin interfaceRelationField- Returns:
- possible object is
String
-
setTargetEntity
public void setTargetEntity(String value)
Sets the value of the targetEntity property.- Specified by:
setTargetEntityin interfaceRelationField- Parameters:
value- allowed object isString
-
getRelatedField
public RelationField getRelatedField()
This is only used for xml converters and will normally return null. Gets the field on the target entity for this relationship.- Specified by:
getRelatedFieldin interfaceRelationField- Returns:
- the field on the target entity for this relationship.
-
setRelatedField
public void setRelatedField(RelationField value)
Gets the field on the target entity for this relationship.- Specified by:
setRelatedFieldin interfaceRelationField- Parameters:
value- field on the target entity for this relationship.
-
isSyntheticField
public boolean isSyntheticField()
This is only used for xml converters and will normally return false. A true value indicates that this field was generated for CMR back references.- Specified by:
isSyntheticFieldin interfaceRelationField- Returns:
- true if this field was generated for CMR back references.
-
setSyntheticField
public void setSyntheticField(boolean syntheticField)
This is only used for xml converters and will normally return false. A true value indicates that this field was generated for CMR back references.- Specified by:
setSyntheticFieldin interfaceRelationField
-
isOrphanRemoval
public Boolean isOrphanRemoval()
Gets the value of the orphanRemoval property.- Returns:
- possible object is
Boolean
-
setOrphanRemoval
public void setOrphanRemoval(Boolean value)
Sets the value of the orphanRemoval property.- Parameters:
value- allowed object isBoolean
-
-