Interface ValueMetaData

    • Field Detail

      • CASCADE_NONE

        static final int CASCADE_NONE
        The operation is not cascaded to this field.
        See Also:
        Constant Field Values
      • CASCADE_IMMEDIATE

        static final int CASCADE_IMMEDIATE
        The operation is immediately cascaded to this field.
        See Also:
        Constant Field Values
      • CASCADE_AUTO

        static final int CASCADE_AUTO
        Use automatic cascade behavior. Persistence-by-reachability, delete-dependent, attach-if-detached, etc.
        See Also:
        Constant Field Values
    • Method Detail

      • getFieldMetaData

        FieldMetaData getFieldMetaData()
        Return the owning field for this value.
      • getType

        java.lang.Class getType()
        The value class.
      • setType

        void setType​(java.lang.Class type)
        The value class.
      • getTypeCode

        int getTypeCode()
        The type code of the value class.
      • setTypeCode

        void setTypeCode​(int code)
        The type code of the value class.
      • isTypePC

        boolean isTypePC()
        Whether the type is a persistence capable instance.
      • getTypeMetaData

        ClassMetaData getTypeMetaData()
        The metadata for the value class, if the type is persistent.
      • getDeclaredType

        java.lang.Class getDeclaredType()
        Return the declared class of the value. This can differ from the return value of getType() if the user indicates a different type or the value has an externalizer.
      • setDeclaredType

        void setDeclaredType​(java.lang.Class type)
        Set the declared class of the value.
      • getDeclaredTypeCode

        int getDeclaredTypeCode()
        Return the declared type code of the value. This can differ from the return value of getTypeCode() if the user indicates a different type or the value has an externalizer.
      • setDeclaredTypeCode

        void setDeclaredTypeCode​(int type)
        Set the type code for the value. The type code is usually computed automatically, but it can be useful to set it explicitly when creating metadatas from scratch.
      • isDeclaredTypePC

        boolean isDeclaredTypePC()
        Whether the type is a persistence capable instance.
      • getDeclaredTypeMetaData

        ClassMetaData getDeclaredTypeMetaData()
        Return metadata for the value's class, if the type is persistent.
      • isEmbedded

        boolean isEmbedded()
        This attribute is a hint to the implementation to store this value in the same structure as the class, rather than as a separate datastore structure. Defaults to true if the field is not a collection or map or persistence-capable object; defaults to false otherwise. Implementations are permitted to ignore this attribute.
      • setEmbedded

        void setEmbedded​(boolean embedded)
        This attribute is a hint to the implementation to store this value in the same structure as the class, rather than as a separate datastore structure. Defaults to true if the field is not a collection or map or persistence-capable objects; defaults to false otherwise. Implementations are permitted to ignore this attribute.
      • isEmbeddedPC

        boolean isEmbeddedPC()
        Whether this is an embedded persistence capable value.
      • getEmbeddedMetaData

        ClassMetaData getEmbeddedMetaData()
        The embedded class metadata for the value.
      • addEmbeddedMetaData

        ClassMetaData addEmbeddedMetaData()
        Add embedded metadata for this value.
      • addEmbeddedMetaData

        ClassMetaData addEmbeddedMetaData​(int access)
        Add embedded metadata for this value with the given access type
      • getCascadeDelete

        int getCascadeDelete()
        Cascade behavior for delete operation. Only applies to persistence-capable values. Options are:
        • CASCADE_NONE: No cascades.
        • CASCADE_IMMEDIATE: Value is deleted immediately when the owning object is deleted.
        • CASCADE_AUTO: Value will be deleted on flush if the owning object is deleted or if the value is removed from the owning object, and if the value is not assigned to another relation in the same transaction.
      • setCascadeDelete

        void setCascadeDelete​(int cascade)
        Cascade behavior for deletion.
        See Also:
        getCascadeDelete()
      • getCascadePersist

        int getCascadePersist()
        Cascade behavior for persist operation. Only applies to persistence-capable values. Options are:
        • CASCADE_NONE: No cascades. If a transient relation is held at flush, an error is thrown.
        • CASCADE_IMMEDIATE: Value is persisted immediately when the owning object is persisted.
        • CASCADE_AUTO: Value will be persisted on flush.
      • setCascadePersist

        void setCascadePersist​(int cascade)
        Cascade behavior for persist operation.
        See Also:
        getCascadePersist()
      • setCascadePersist

        void setCascadePersist​(int cascade,
                               boolean checkPUDefault)
        Cascade behavior for persist operation.
        See Also:
        getCascadePersist()
      • getCascadeAttach

        int getCascadeAttach()
        Cascade behavior for attach operation. Only applies to persistence-capable values. Options are:
        • CASCADE_NONE: No cascades of attach. Relation remains detached.
        • CASCADE_IMMEDIATE: Value is attached immediately.
      • setCascadeAttach

        void setCascadeAttach​(int cascade)
        Cascade behavior for attach operation.
        See Also:
        getCascadeAttach()
      • getCascadeDetach

        int getCascadeDetach()
        Cascade behavior for detach operation. Only applies to persistence-capable values. Options are:
        • CASCADE_NONE: No cascades of detach. Relation remains attached.
        • CASCADE_IMMEDIATE: Value is detached immediately.
      • setCascadeDetach

        void setCascadeDetach​(int cascade)
        Cascade behavior for detach operation.
        See Also:
        getCascadeDetach()
      • getCascadeRefresh

        int getCascadeRefresh()
        Cascade behavior for refresh operation. Only applies to persistence-capable values. Options are:
        • CASCADE_NONE: No cascades of refresh.
        • CASCADE_IMMEDIATE: Persistent value object is also refreshed.
        • CASCADE_AUTO: Value will be refreshed if it is in the current fetch groups.
      • setCascadeRefresh

        void setCascadeRefresh​(int cascade)
        Cascade behavior for refresh operation.
        See Also:
        getCascadeRefresh()
      • isSerialized

        boolean isSerialized()
        Whether this value is serialized when stored.
      • setSerialized

        void setSerialized​(boolean serialized)
        Whether this value is serialized when stored.
      • getValueMappedBy

        java.lang.String getValueMappedBy()
        The field that this value shares a mapping with. Currently the only supported use for a mapped-by value is when a map field key is determined by a field of the persistence-capable map value.
      • setValueMappedBy

        void setValueMappedBy​(java.lang.String mapped)
        The field that this value shares a mapping with. Currently the only supported use for a mapped-by value is when a map field key is determined by a field of the persistence-capable map value.
      • getValueMappedByMetaData

        FieldMetaData getValueMappedByMetaData()
        The field that this value shares a mapping with. Currently the only supported use for a mapped-by value is when a map field key is determined by a field of the persistence-capable map value.
      • getTypeOverride

        java.lang.Class getTypeOverride()
        User-supplied type overriding assumed type based on field.
      • setTypeOverride

        void setTypeOverride​(java.lang.Class type)
        User-supplied type overriding assumed type based on field.
      • getResolve

        int getResolve()
        Resolve mode for metadata.
      • setResolve

        void setResolve​(int mode)
        Resolve mode for metadata.
      • setResolve

        void setResolve​(int mode,
                        boolean on)
        Resolve mode for metadata.
      • resolve

        boolean resolve​(int mode)
        Resolve and validate metadata. Return true if already resolved.
      • copy

        void copy​(ValueMetaData vmd)
        Copy state from the given value to this one. Do not copy mapping information.