Class AttributeOptionsImpl

    • Field Detail

      • OPTION_DEFAULT

        public static final java.lang.String OPTION_DEFAULT
        generate SQL DEFAULT.
        See Also:
        Constant Field Values
      • OPTION_INIT

        public static final java.lang.String OPTION_INIT
        initial value.
        See Also:
        Constant Field Values
      • OPTION_CONTEXT

        public static final java.lang.String OPTION_CONTEXT
        this is the object id holding the context.
        See Also:
        Constant Field Values
      • OPTION_DOMAINKEY

        public static final java.lang.String OPTION_DOMAINKEY
        this is a unique domain key (or part of it).
        See Also:
        Constant Field Values
      • OPTION_TZ

        public static final java.lang.String OPTION_TZ
        timestamp, date or time with database timezone.
        See Also:
        Constant Field Values
      • OPTION_HIDDEN

        public static final java.lang.String OPTION_HIDDEN
        hidden attribute (no interface definition).
        See Also:
        Constant Field Values
      • OPTION_SHALLOW

        public static final java.lang.String OPTION_SHALLOW
        shallow attribute (ignored in snapshots and copies).
        See Also:
        Constant Field Values
    • Constructor Detail

      • AttributeOptionsImpl

        public AttributeOptionsImpl​(Attribute attribute,
                                    SourceInfo sourceInfo)
        Creates attribute options.
        Parameters:
        attribute - the attribute
        sourceInfo - the source info, null if none
    • Method Detail

      • applyEntityOptions

        public void applyEntityOptions​(EntityOptions options,
                                       DataType dataType)
        Sets the default from entity options.
        Parameters:
        options - the entity options
        dataType - the datatype of the attribute
      • applyOption

        public boolean applyOption​(java.lang.String option,
                                   java.lang.Boolean ctrl)
                            throws ModelException
        Description copied from class: CommonOptionsImpl
        Applies given option string.
        Overrides:
        applyOption in class CommonOptionsImpl
        Parameters:
        option - the option string
        ctrl - option control: true if turn option on, false if oprion off, null if on/off missing (defaults to on)
        Returns:
        true if applied, false if unknown option
        Throws:
        ModelException - if applying the option failed
      • getAnnotations

        public java.util.List<java.lang.String> getAnnotations()
        Description copied from interface: AttributeOptions
        list of annotations.
        Specified by:
        getAnnotations in interface AttributeOptions
        Returns:
        the annotations
      • getDefaultValue

        public java.lang.Object getDefaultValue()
        Description copied from interface: AttributeOptions
        Gets the default value if [DEFAULT value] given.
        The returned type corresponds to the DataType of the Attribute.
        Specified by:
        getDefaultValue in interface AttributeOptions
        Returns:
        the defaultValue
      • getInitialValue

        public java.lang.String getInitialValue()
        Description copied from interface: AttributeOptions
        Gets the initial value if [INIT value] given.
        Specified by:
        getInitialValue in interface AttributeOptions
        Returns:
        the string to initialize the declaration with
      • setAnnotations

        public void setAnnotations​(java.util.List<java.lang.String> annotations)
      • setDefaultValue

        public void setDefaultValue​(java.lang.Object defaultValue)
      • setInitialValue

        public void setInitialValue​(java.lang.String initialValue)
      • isContextId

        public boolean isContextId()
        Description copied from interface: AttributeOptions
        Returns whether this is the object id holding the context.
        Specified by:
        isContextId in interface AttributeOptions
        Returns:
        true if context id
      • setContextId

        public void setContextId​(boolean contextId)
      • isDomainKey

        public boolean isDomainKey()
        Description copied from interface: AttributeOptions
        Returns whether this is a unique domain key (or part of it).
        Specified by:
        isDomainKey in interface AttributeOptions
        Returns:
        true if domain key
      • setDomainKey

        public void setDomainKey​(boolean domainKey)
      • isUTC

        public boolean isUTC()
        Description copied from interface: AttributeOptions
        Returns whether this is a UTC timestamp.
        Specified by:
        isUTC in interface AttributeOptions
        Returns:
        true if UTC
      • setUTC

        public void setUTC​(boolean utc)
      • isWithTimezone

        public boolean isWithTimezone()
        Description copied from interface: AttributeOptions
        Returns whether to use a dedicated timezone.
        If set, the PDO must provide a method to configure the timezone for the given attribute of the form:
         Calendar get<attribute-name>TimezoneConfig();
        
         Example: Calendar getPrintedTimezoneConfig();
         
        Specified by:
        isWithTimezone in interface AttributeOptions
        Returns:
        true if with timezone
      • setWithTimezone

        public void setWithTimezone​(boolean withTimezone)
      • isUnsigned

        public boolean isUnsigned()
        Description copied from interface: AttributeOptions
        Returns whether this is an unsigned numeric field.
        Specified by:
        isUnsigned in interface AttributeOptions
        Returns:
        true if unsigned
      • setUnsigned

        public void setUnsigned​(boolean unsigned)
      • isHidden

        public boolean isHidden()
        Description copied from interface: AttributeOptions
        Returns whether the attribute is not declared in the interface.
        Specified by:
        isHidden in interface AttributeOptions
        Returns:
        true if implemented only, no public interface definition
      • setHidden

        public void setHidden​(boolean hidden)
      • isShallow

        public boolean isShallow()
        Description copied from interface: AttributeOptions
        Returns whether the attribute should be skipped in snapshot and copy operations.
        Specified by:
        isShallow in interface AttributeOptions
        Returns:
        true if skip this attribute, false to include (default)
      • setShallow

        public void setShallow​(boolean shallow)