java.lang.Object
org.tentackle.maven.plugin.wizard.pdodata.DataItem
All Implemented Interfaces:
DataNode

public class DataItem extends Object implements DataNode
A simple java attribute or property of a PDO.
Such as
String blah = "some text"
  • Constructor Details

    • DataItem

      public DataItem(String type, String name, Object value, String comment, Entity entity, Attribute attribute, boolean idOfCompositeRelation, NonCompositeRelation nonCompositeRelation, SqlCondition sqlCondition)
      Creates a DataItem.
      Parameters:
      type - the type basename
      name - the property name
      value - the property value, may be null
      comment - the optional comment
      entity - the effective entity
      attribute - the model attribute, null if not in model
      idOfCompositeRelation - true if this an ID of a composite object relation
      nonCompositeRelation - the non-composite relation, may be null
      sqlCondition - the SQL where condition
  • Method Details

    • getType

      public String getType()
      Gets the type basename.
      Specified by:
      getType in interface DataNode
      Returns:
      the type basename
    • getName

      public String getName()
      Gets the property name.
      Specified by:
      getName in interface DataNode
      Returns:
      the property name
    • isHidden

      public boolean isHidden()
      Description copied from interface: DataNode
      Gets the hidden flag.
      Specified by:
      isHidden in interface DataNode
      Returns:
      true if object is hidden (no public method available)
    • getValue

      public String getValue()
      Gets the property value, may be null.
      Specified by:
      getValue in interface DataNode
      Returns:
      the property value, may be null
    • getOrgValue

      public Object getOrgValue()
      Gets the original object of the displayed value.
      Returns:
      the value, may be null
    • getComment

      public String getComment()
      Description copied from interface: DataNode
      The optional comment.
      Specified by:
      getComment in interface DataNode
      Returns:
      the comment, null if none
    • getNodes

      public List<DataNode> getNodes()
      Description copied from interface: DataNode
      Gets the optional sub nodes of this node.
      Specified by:
      getNodes in interface DataNode
      Returns:
      the nodes, null if this node has no sub nodes
    • getAttribute

      public Attribute getAttribute()
      Gets the associated attribute in the model.
      Notice that some items have no model equivalent, such as classId.
      Returns:
      the attribute, null if not in model
    • getEntity

      public Entity getEntity()
      Description copied from interface: DataNode
      Gets the entity this node belongs to.
      Specified by:
      getEntity in interface DataNode
      Returns:
      the entity
    • isIdOfCompositeRelation

      public boolean isIdOfCompositeRelation()
      Returns whether this the ID of a composite object relation.
      Returns:
      true if skip in code generation
    • getNonCompositeRelation

      public NonCompositeRelation getNonCompositeRelation()
      Gets the optional object relation.
      Returns:
      the non-composite 1:1 relation, null if none
    • setConfigurationPath

      public void setConfigurationPath(String configurationPath)
      Description copied from interface: DataNode
      Sets the optional configuration path.
      Specified by:
      setConfigurationPath in interface DataNode
      Parameters:
      configurationPath - the path
    • getConfigurationPath

      public String getConfigurationPath()
      Description copied from interface: DataNode
      Gets the optional configuration path.
      Specified by:
      getConfigurationPath in interface DataNode
      Returns:
      the path, null if none
    • getSqlCondition

      public SqlCondition getSqlCondition()
      Description copied from interface: DataNode
      Returns the SQL select configuration for the where clause.
      Specified by:
      getSqlCondition in interface DataNode
      Returns:
      the sql config
    • isCounterForListRelation

      public boolean isCounterForListRelation()
      Determines whether this attribute is a counter for a composite list relation.
      Used by the code generator to skip such items.
      Returns:
      true if counter
    • isKey

      public boolean isKey()
      Returns whether this item is part of the unique domain key.
      Returns:
      true if key
    • toString

      public String toString()
      Overrides:
      toString in class Object