Class OneToOne

  • All Implemented Interfaces:
    RelationField, Keyable

    public class OneToOne
    extends Object
    implements RelationField
    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; }

    Java class for one-to-one complex type.

    The following schema fragment specifies the expected content contained within this class.

     <complexType name="one-to-one">
       <complexContent>
         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
           <sequence>
             <choice>
               <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="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="fetch" type="{http://java.sun.com/xml/ns/persistence/orm}fetch-type" />
           <attribute name="mapped-by" type="{http://www.w3.org/2001/XMLSchema}string" />
           <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
           <attribute name="optional" type="{http://www.w3.org/2001/XMLSchema}boolean" />
           <attribute name="target-entity" type="{http://www.w3.org/2001/XMLSchema}string" />
           <attribute name="access" type="{http://java.sun.com/xml/ns/persistence/orm}access-type" />
           <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>
     
    • Constructor Detail

      • OneToOne

        public OneToOne()
    • Method Detail

      • 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 a set method 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 list PrimaryKeyJoinColumn
      • 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 a set method 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 list JoinColumn
        Specified by:
        getJoinColumn in interface RelationField
      • 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 is AccessType
      • setMappedBy

        public void setMappedBy​(String value)
        Sets the value of the mappedBy property.
        Specified by:
        setMappedBy in interface RelationField
        Parameters:
        value - allowed object is String
      • 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 is Boolean
      • 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 is String
      • isId

        public Boolean isId()
        Gets the value of the id property.
        Returns:
        possible object is Boolean
      • setId

        public void setId​(Boolean value)
        Sets the value of the id property.
        Parameters:
        value - allowed object is Boolean
      • setName

        public void setName​(String value)
        Sets the value of the name property.
        Specified by:
        setName in interface RelationField
        Parameters:
        value - allowed object is String
      • 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 is Boolean
      • setTargetEntity

        public void setTargetEntity​(String value)
        Sets the value of the targetEntity property.
        Specified by:
        setTargetEntity in interface RelationField
        Parameters:
        value - allowed object is String
      • 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:
        getRelatedField in interface RelationField
        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:
        setRelatedField in interface RelationField
        Parameters:
        value - field on the target entity for this relationship.
      • isSyntheticField

        public boolean isSyntheticField()
        Description copied from interface: RelationField
        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:
        isSyntheticField in interface RelationField
        Returns:
        true if this field was generated for CMR back references.
      • setSyntheticField

        public void setSyntheticField​(boolean syntheticField)
        Description copied from interface: RelationField
        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:
        setSyntheticField in interface RelationField
      • getKey

        public Object getKey()
        Description copied from interface: Keyable
        Gets the immutable key for this object.
        Specified by:
        getKey in interface Keyable
        Returns:
        gets the immutable key for this object