Class ModelField

java.lang.Object
org.apache.ofbiz.entity.model.ModelChild
org.apache.ofbiz.entity.model.ModelField
All Implemented Interfaces:
Serializable

@ThreadSafe public final class ModelField extends ModelChild
An object that models the <field> element.
See Also:
  • Method Details

    • create

      public static ModelField create(ModelEntity modelEntity, String name, String type, boolean isPk)
      Returns a new ModelField instance, initialized with the specified values.
      Parameters:
      modelEntity - The ModelEntity this field is a member of.
      name - The field name.
      type - The field type.
      isPk - true if this field is part of the primary key.
    • create

      public static ModelField create(ModelEntity modelEntity, String description, String name, String type, String colName, String colValue, String fieldSet, boolean isNotNull, boolean isPk, boolean encrypt, boolean isAutoCreatedInternal, boolean enableAuditLog, List<String> validators)
      Returns a new ModelField instance, initialized with the specified values.
      Parameters:
      modelEntity - The ModelEntity this field is a member of.
      description - The field description.
      name - The field name.
      type - The field type.
      colName - The data source column name for this field. Will be generated automatically if left empty.
      colValue -
      fieldSet - The field set name this field is a member of.
      isNotNull - true if this field cannot contain a null value.
      isPk - true if this field is part of the primary key.
      encrypt - true if this field is encrypted.
      isAutoCreatedInternal - true if this field was generated automatically by the entity engine.
      enableAuditLog - true if this field is included in the entity audit log.
      validators - The validators for this field.
    • create

      public static ModelField create(ModelEntity modelEntity, String description, String name, String type, String colName, String colValue, String fieldSet, boolean isNotNull, boolean isPk, ModelField.EncryptMethod encrypt, boolean isAutoCreatedInternal, boolean enableAuditLog, List<String> validators)
    • create

      public static ModelField create(ModelEntity modelEntity, Element fieldElement, boolean isPk)
      Returns a new ModelField instance, initialized with the specified values.
      Parameters:
      modelEntity - The ModelEntity this field is a member of.
      fieldElement - The <field> element containing the values for this field.
      isPk - true if this field is part of the primary key.
    • create

      public static ModelField create(ModelEntity modelEntity, DatabaseUtil.ColumnCheckInfo ccInfo, ModelFieldTypeReader modelFieldTypeReader)
      Returns a new ModelField instance, initialized with the specified values.
      Parameters:
      modelEntity - The ModelEntity this field is a member of.
      ccInfo - The ColumnCheckInfo containing the values for this field.
      modelFieldTypeReader -
    • getName

      public String getName()
      Returns the name of this field.
    • getType

      public String getType()
      Returns the type of this field.
    • getColName

      public String getColName()
      Returns the data source column name of this field.
    • getColValue

      public String getColValue()
    • getIsPk

      public boolean getIsPk()
      Returns true if this field is part of the primary key.
    • getIsNotNull

      public boolean getIsNotNull()
      Returns true if this field cannot contain null.
    • getEncrypt

      @Deprecated public boolean getEncrypt()
      Deprecated.
      Returns true if this field is encrypted.
    • getEncryptMethod

      public ModelField.EncryptMethod getEncryptMethod()
    • getEnableAuditLog

      public boolean getEnableAuditLog()
      Returns true if this field is included in the entity audit log.
    • getIsAutoCreatedInternal

      public boolean getIsAutoCreatedInternal()
      Returns true if this field was generated automatically by the entity engine.
    • getFieldSet

      public String getFieldSet()
      Returns the field set name this field is a member of.
    • getValidators

      public List<String> getValidators()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toXmlElement

      public Element toXmlElement(Document document)