public class OneToOne extends Object
@Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface OneToOne { Class targetEntity() default void.class; CascadeType[] cascade() default {}; FetchType fetch() default EAGER; boolean optional() default true; String mappedBy() default ""; boolean orphanRemoval() default false; }
<p>Java class for one-to-one complex type.
<p>The following schema fragment specifies the expected content contained within this class.
<pre> <complexType name="one-to-one"> <complexContent> <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> <sequence> <choice> <sequence> <element name="primary-key-join-column" type="{http://xmlns.jcp.org/xml/ns/persistence/orm}primary-key-join-column" maxOccurs="unbounded" minOccurs="0"/> <element name="primary-key-foreign-key" type="{http://xmlns.jcp.org/xml/ns/persistence/orm}foreign-key" minOccurs="0"/> </sequence> <sequence> <element name="join-column" type="{http://xmlns.jcp.org/xml/ns/persistence/orm}join-column" maxOccurs="unbounded" minOccurs="0"/> <element name="foreign-key" type="{http://xmlns.jcp.org/xml/ns/persistence/orm}foreign-key" minOccurs="0"/> </sequence> <element name="join-table" type="{http://xmlns.jcp.org/xml/ns/persistence/orm}join-table" minOccurs="0"/> </choice> <element name="cascade" type="{http://xmlns.jcp.org/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://xmlns.jcp.org/xml/ns/persistence/orm}fetch-type" /> <attribute name="optional" type="{http://www.w3.org/2001/XMLSchema}boolean" /> <attribute name="access" type="{http://xmlns.jcp.org/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" /> <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> </pre>
| Modifier and Type | Field and Description |
|---|---|
protected AccessType |
access |
protected CascadeType |
cascade |
protected FetchType |
fetch |
protected ForeignKey |
foreignKey |
protected Boolean |
id |
protected List<JoinColumn> |
joinColumn |
protected JoinTable |
joinTable |
protected String |
mappedBy |
protected String |
mapsId |
protected String |
name |
protected Boolean |
optional |
protected Boolean |
orphanRemoval |
protected ForeignKey |
primaryKeyForeignKey |
protected List<PrimaryKeyJoinColumn> |
primaryKeyJoinColumn |
protected String |
targetEntity |
| Constructor and Description |
|---|
OneToOne() |
| Modifier and Type | Method and Description |
|---|---|
AccessType |
getAccess()
Gets the value of the access property.
|
CascadeType |
getCascade()
Gets the value of the cascade property.
|
FetchType |
getFetch()
Gets the value of the fetch property.
|
ForeignKey |
getForeignKey()
Gets the value of the foreignKey property.
|
List<JoinColumn> |
getJoinColumn()
Gets the value of the joinColumn property.
|
JoinTable |
getJoinTable()
Gets the value of the joinTable property.
|
String |
getMappedBy()
Gets the value of the mappedBy property.
|
String |
getMapsId()
Gets the value of the mapsId property.
|
String |
getName()
Gets the value of the name property.
|
ForeignKey |
getPrimaryKeyForeignKey()
Gets the value of the primaryKeyForeignKey property.
|
List<PrimaryKeyJoinColumn> |
getPrimaryKeyJoinColumn()
Gets the value of the primaryKeyJoinColumn property.
|
String |
getTargetEntity()
Gets the value of the targetEntity property.
|
Boolean |
isId()
Gets the value of the id property.
|
Boolean |
isOptional()
Gets the value of the optional property.
|
Boolean |
isOrphanRemoval()
Gets the value of the orphanRemoval property.
|
void |
setAccess(AccessType value)
Sets the value of the access property.
|
void |
setCascade(CascadeType value)
Sets the value of the cascade property.
|
void |
setFetch(FetchType value)
Sets the value of the fetch property.
|
void |
setForeignKey(ForeignKey value)
Sets the value of the foreignKey property.
|
void |
setId(Boolean value)
Sets the value of the id property.
|
void |
setJoinTable(JoinTable value)
Sets the value of the joinTable property.
|
void |
setMappedBy(String value)
Sets the value of the mappedBy property.
|
void |
setMapsId(String value)
Sets the value of the mapsId property.
|
void |
setName(String value)
Sets the value of the name property.
|
void |
setOptional(Boolean value)
Sets the value of the optional property.
|
void |
setOrphanRemoval(Boolean value)
Sets the value of the orphanRemoval property.
|
void |
setPrimaryKeyForeignKey(ForeignKey value)
Sets the value of the primaryKeyForeignKey property.
|
void |
setTargetEntity(String value)
Sets the value of the targetEntity property.
|
protected List<PrimaryKeyJoinColumn> primaryKeyJoinColumn
protected ForeignKey primaryKeyForeignKey
protected List<JoinColumn> joinColumn
protected ForeignKey foreignKey
protected JoinTable joinTable
protected CascadeType cascade
protected String name
protected String targetEntity
protected FetchType fetch
protected Boolean optional
protected AccessType access
protected String mappedBy
protected Boolean orphanRemoval
protected String mapsId
protected Boolean id
public List<PrimaryKeyJoinColumn> getPrimaryKeyJoinColumn()
Gets the value of the primaryKeyJoinColumn property.
<p> 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 a <CODE>set</CODE> method for the primaryKeyJoinColumn property.
<p> For example, to add a new item, do as follows: <pre> getPrimaryKeyJoinColumn().add(newItem); </pre>
<p>
Objects of the following type(s) are allowed in the list
PrimaryKeyJoinColumn
public ForeignKey getPrimaryKeyForeignKey()
Gets the value of the primaryKeyForeignKey property.
ForeignKeypublic void setPrimaryKeyForeignKey(ForeignKey value)
Sets the value of the primaryKeyForeignKey property.
value - allowed object is
ForeignKeypublic List<JoinColumn> getJoinColumn()
Gets the value of the joinColumn property.
<p> 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 a <CODE>set</CODE> method for the joinColumn property.
<p> For example, to add a new item, do as follows: <pre> getJoinColumn().add(newItem); </pre>
<p>
Objects of the following type(s) are allowed in the list
JoinColumn
public ForeignKey getForeignKey()
Gets the value of the foreignKey property.
ForeignKeypublic void setForeignKey(ForeignKey value)
Sets the value of the foreignKey property.
value - allowed object is
ForeignKeypublic JoinTable getJoinTable()
Gets the value of the joinTable property.
JoinTablepublic void setJoinTable(JoinTable value)
Sets the value of the joinTable property.
value - allowed object is
JoinTablepublic CascadeType getCascade()
Gets the value of the cascade property.
CascadeTypepublic void setCascade(CascadeType value)
Sets the value of the cascade property.
value - allowed object is
CascadeTypepublic String getName()
Gets the value of the name property.
Stringpublic void setName(String value)
Sets the value of the name property.
value - allowed object is
Stringpublic String getTargetEntity()
Gets the value of the targetEntity property.
Stringpublic void setTargetEntity(String value)
Sets the value of the targetEntity property.
value - allowed object is
Stringpublic FetchType getFetch()
Gets the value of the fetch property.
FetchTypepublic void setFetch(FetchType value)
Sets the value of the fetch property.
value - allowed object is
FetchTypepublic Boolean isOptional()
Gets the value of the optional property.
Booleanpublic void setOptional(Boolean value)
Sets the value of the optional property.
value - allowed object is
Booleanpublic AccessType getAccess()
Gets the value of the access property.
AccessTypepublic void setAccess(AccessType value)
Sets the value of the access property.
value - allowed object is
AccessTypepublic String getMappedBy()
Gets the value of the mappedBy property.
Stringpublic void setMappedBy(String value)
Sets the value of the mappedBy property.
value - allowed object is
Stringpublic Boolean isOrphanRemoval()
Gets the value of the orphanRemoval property.
Booleanpublic void setOrphanRemoval(Boolean value)
Sets the value of the orphanRemoval property.
value - allowed object is
Booleanpublic String getMapsId()
Gets the value of the mapsId property.
Stringpublic void setMapsId(String value)
Sets the value of the mapsId property.
value - allowed object is
StringCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.