Package org.apache.openejb.jee.jpa
Class ManyToOne
- java.lang.Object
-
- org.apache.openejb.jee.jpa.ManyToOne
-
- All Implemented Interfaces:
RelationField,Keyable
public class ManyToOne extends Object implements RelationField
Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface ManyToOne { Class targetEntity() default void.class; CascadeType[] cascade() default {}; FetchType fetch() default EAGER; boolean optional() default true; }Java class for many-to-one complex type.
The following schema fragment specifies the expected content contained within this class.
<complexType name="many-to-one"> <complexContent> <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> <choice> <element name="join-column" type="{http://java.sun.com/xml/ns/persistence/orm}join-column" maxOccurs="unbounded" minOccurs="0"/> <element name="join-table" type="{http://java.sun.com/xml/ns/persistence/orm}join-table" 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="optional" type="{http://www.w3.org/2001/XMLSchema}boolean" /> <attribute name="access" type="{http://java.sun.com/xml/ns/persistence/orm}access-type" /> <attribute name="maps-id" type="{http://www.w3.org/2001/XMLSchema}string" /> <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}boolean" /> </restriction> </complexContent> </complexType>
-
-
Field Summary
Fields Modifier and Type Field Description protected AccessTypeaccessprotected CascadeTypecascadeprotected FetchTypefetchprotected Booleanidprotected List<JoinColumn>joinColumnprotected JoinTablejoinTableprotected StringmapsIdprotected Stringnameprotected Booleanoptionalprotected RelationFieldrelatedFieldprotected booleansyntheticFieldprotected StringtargetEntity
-
Constructor Summary
Constructors Constructor Description ManyToOne()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessTypegetAccess()Gets the value of the access property.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.StringgetMappedBy()StringgetMapsId()Gets the value of the mapsId property.StringgetName()Gets the value of the name property.RelationFieldgetRelatedField()This is only used for xml converters and will normally return null.StringgetTargetEntity()Gets the value of the targetEntity property.BooleanisId()Gets the value of the id property.BooleanisOptional()Gets the value of the optional property.booleanisSyntheticField()This is only used for xml converters and will normally return false.voidsetAccess(AccessType value)Sets the value of the access property.voidsetCascade(CascadeType value)Sets the value of the cascade property.voidsetFetch(FetchType value)Sets the value of the fetch property.voidsetId(Boolean value)Sets the value of the id property.voidsetJoinTable(JoinTable value)Sets the value of the joinTable property.voidsetMappedBy(String value)voidsetMapsId(String value)Sets the value of the mapsId property.voidsetName(String value)Sets the value of the name property.voidsetOptional(Boolean value)Sets the value of the optional 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
-
joinColumn
protected List<JoinColumn> joinColumn
-
joinTable
protected JoinTable joinTable
-
cascade
protected CascadeType cascade
-
fetch
protected FetchType fetch
-
name
protected String name
-
optional
protected Boolean optional
-
targetEntity
protected String targetEntity
-
relatedField
protected RelationField relatedField
-
syntheticField
protected boolean syntheticField
-
access
protected AccessType access
-
mapsId
protected String mapsId
-
id
protected Boolean id
-
-
Method Detail
-
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
-
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
-
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
-
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
-
isOptional
public Boolean isOptional()
Gets the value of the optional property.- Returns:
- possible object is
Boolean
-
setOptional
public void setOptional(Boolean value)
Sets the value of the optional property.- Parameters:
value- allowed object isBoolean
-
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
-
getMappedBy
public String getMappedBy()
- Specified by:
getMappedByin interfaceRelationField
-
setMappedBy
public void setMappedBy(String value)
- Specified by:
setMappedByin interfaceRelationField
-
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
-
getKey
public Object getKey()
Description copied from interface:KeyableGets the immutable key for this object.
-
getAccess
public AccessType getAccess()
Gets the value of the access property.- Returns:
- possible object is
AccessType
-
setAccess
public void setAccess(AccessType value)
Sets the value of the access property.- Parameters:
value- allowed object isAccessType
-
getMapsId
public String getMapsId()
Gets the value of the mapsId property.- Returns:
- possible object is
String
-
setMapsId
public void setMapsId(String value)
Sets the value of the mapsId property.- Parameters:
value- allowed object isString
-
-