Class TdbFieldGroupDesign

java.lang.Object
com.tietoenator.trip.jxp.database.TdbFieldGroupDesign
All Implemented Interfaces:
com.tietoenator.trip.jxp.internal.utils.DOMSink, Comparable<TdbFieldGroupDesign>

public class TdbFieldGroupDesign extends Object implements com.tietoenator.trip.jxp.internal.utils.DOMSink, Comparable<TdbFieldGroupDesign>
Container and logic relating to a specific field group within a database design
Since:
TRIPjxp 8.0-0
  • Constructor Details

    • TdbFieldGroupDesign

      public TdbFieldGroupDesign()
      Constructor, creates a blank field group design
    • TdbFieldGroupDesign

      public TdbFieldGroupDesign(TdbFieldGroupDesign src)
      Copy constructor, performs a deep copy from a provided source.
      Parameters:
      src - The source from which to copy.
  • Method Details

    • clear

      public void clear()
      Clear the contents of the field group design, reset all values to their default state.
    • getGroupName

      public String getGroupName()
      Get the name of the field group.
    • setGroupName

      public void setGroupName(String name)
      Set the name of the field group.
      Parameters:
      name - Field group nanme Field groups belong to the same namespace as the fields in the database. A field group cannot therefore have the same name as a field.
    • getDescription

      public String getDescription()
      Get the description of the field group.
    • setDescription

      public void setDescription(String comment)
      Set the description of the field group.
    • getGroupNumber

      public int getGroupNumber()
      Get the field group's unique ID.
    • setGroupNumber

      public void setGroupNumber(int nr)
      Assign the field group's unique ID.
      Parameters:
      nr - Field group number Please note that a field group's number is set by the server and can't be modified meaningfully. This setter method is only used during serialization ' of TdbFieldGroupDesign instances.
    • getGroupType

      public TdbFieldGroupType getGroupType()
      Get the type of the field group

      All types of fields groups represent a group of two or more fields, and can be used in a VIEW-like manner, i.e. act as a field name in a search expression. Searching using a group name will search in all fields in the group.

      Tuple field groups declare to TRIP that the fields in the group are tupled. When records are committed to the database, TRIP will verify that the fields in the tuple group have the same number of subfields. If not, the commit will fail.

    • setGroupType

      public void setGroupType(TdbFieldGroupType groupType)
      Set the field group type.
      Parameters:
      groupType - Field group type

      All types of fields groups represent a group of two or more fields, and can be used in a VIEW-like manner, i.e. act as a field name in a search expression. Searching using a group name will search in all fields in the group.

      Tuple field groups declare to TRIP that the fields in the group are tupled. When records are committed to the database, TRIP will verify that the fields in the tuple group have the same number of subfields. If not, the commit will fail.

      Changing a structural field group to a tuple field group will work provided that:

      • None of the fields is a STRING or TEXT field.
      • None of the fields belong to another tuple field group.

      Note that this kind of change does not update any records in the database, which means that records with fields belonging to the tuple such that the fields that have differing number of subfields will have to be adjusted the next time the record is updated.

    • getFieldCount

      public int getFieldCount()
      The number of fields in this group.
    • getFieldByIndex

      public String getFieldByIndex(int index) throws TdbException
      Retrieve the n'th field within the field group design.
      Parameters:
      index - The zero-based index of the field in the group.
      Throws:
      TdbException - If the index is outside the valid range The order of the fields in the group is not significant to TRIP and is therfore not guaranteed to always be the same.
    • getFields

      public List<String> getFields()
      Get the names of the fields in the field group.
    • setFields

      public void setFields(List<String> fields)
      Set the names of the fields in the field group.
      Parameters:
      fields - List of field names to assign to the group
    • setFields

      public void setFields(String[] fields)
      Set the names of the fields in the field group.
      Parameters:
      fields - List of field names to assign to the group
    • sinkNode

      public void sinkNode(Node node, Object arg)
      Deserialization support.
      Specified by:
      sinkNode in interface com.tietoenator.trip.jxp.internal.utils.DOMSink
      Parameters:
      node - The node
      arg - An optional argument
    • equals

      public boolean equals(Object o)
      Compares to another object; equality is defined by field group number only
      Overrides:
      equals in class Object
      Parameters:
      o - Object with which to compare
      Returns:
      true if field group numbers match
    • compareTo

      public int compareTo(TdbFieldGroupDesign fgroup)
      Order this object with relation to another -- required to be able to sort a collection of these objects.
      Specified by:
      compareTo in interface Comparable<TdbFieldGroupDesign>
      Parameters:
      fgroup - The field to compare to the current; ordering is performed using the field group number only
      Returns:
      -1 if this field group's number is lower than that on the provided object; +1 if this field group's number is higher than that on the provided object; 0 if the field group numbers are the same