Class TdbFieldGroupDesign
- java.lang.Object
-
- com.tietoenator.trip.jxp.database.TdbFieldGroupDesign
-
- All Implemented Interfaces:
com.tietoenator.trip.jxp.internal.utils.DOMSink
,java.lang.Comparable<TdbFieldGroupDesign>
public class TdbFieldGroupDesign extends java.lang.Object implements com.tietoenator.trip.jxp.internal.utils.DOMSink, java.lang.Comparable<TdbFieldGroupDesign>
Container and logic relating to a specific field group within a database design- Since:
- TRIPjxp 8.0-0
-
-
Constructor Summary
Constructors Constructor Description TdbFieldGroupDesign()
Constructor, creates a blank field group designTdbFieldGroupDesign(TdbFieldGroupDesign src)
Copy constructor, performs a deep copy from a provided source.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear the contents of the field group design, reset all values to their default state.int
compareTo(TdbFieldGroupDesign fgroup)
Order this object with relation to another -- required to be able to sort a collection of these objects.boolean
equals(java.lang.Object o)
Compares to another object; equality is defined by field group number onlyjava.lang.String
getDescription()
Get the description of the field group.java.lang.String
getFieldByIndex(int index)
Retrieve the n'th field within the field group design.int
getFieldCount()
The number of fields in this group.java.util.List<java.lang.String>
getFields()
Get the names of the fields in the field group.java.lang.String
getGroupName()
Get the name of the field group.int
getGroupNumber()
Get the field group's unique ID.TdbFieldGroupType
getGroupType()
Get the type of the field groupvoid
setDescription(java.lang.String comment)
Set the description of the field group.void
setFields(java.lang.String[] fields)
Set the names of the fields in the field group.void
setFields(java.util.List<java.lang.String> fields)
Set the names of the fields in the field group.void
setGroupName(java.lang.String name)
Set the name of the field group.void
setGroupNumber(int nr)
Assign the field group's unique ID.void
setGroupType(TdbFieldGroupType groupType)
Set the field group type.void
sinkNode(org.w3c.dom.Node node, java.lang.Object arg)
Deserialization support.
-
-
-
Constructor Detail
-
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 Detail
-
clear
public void clear()
Clear the contents of the field group design, reset all values to their default state.
-
getGroupName
public java.lang.String getGroupName()
Get the name of the field group.
-
setGroupName
public void setGroupName(java.lang.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 java.lang.String getDescription()
Get the description of the field group.
-
setDescription
public void setDescription(java.lang.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 groupAll 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 typeAll 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 java.lang.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 java.util.List<java.lang.String> getFields()
Get the names of the fields in the field group.
-
setFields
public void setFields(java.util.List<java.lang.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(java.lang.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(org.w3c.dom.Node node, java.lang.Object arg)
Deserialization support.- Specified by:
sinkNode
in interfacecom.tietoenator.trip.jxp.internal.utils.DOMSink
- Parameters:
node
- The nodearg
- An optional argument
-
equals
public boolean equals(java.lang.Object o)
Compares to another object; equality is defined by field group number only- Overrides:
equals
in classjava.lang.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 interfacejava.lang.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
-
-