Class SearchFieldDTO

java.lang.Object
net.sourceforge.jbizmo.commons.search.dto.SearchFieldDTO
All Implemented Interfaces:
Serializable, Comparable<SearchFieldDTO>

public class SearchFieldDTO extends Object implements Serializable, Comparable<SearchFieldDTO>

Data transfer object that represents all information for building query fragments on field level. There are three special properties that must be mentioned: 1) fetchIndex: This index is used to ease reading of resultset data. 2) columnIndex: If a field is visible the value is greater or equal 0. This index is equivalent to the table column index. 3) colOrder: This value represents the column order. Note that this class has a natural ordering (see method compareTo()) that is inconsistent with equals().

Copyright 2010 (C) by Martin Ganserer

Version:
1.0.0
Author:
Martin Ganserer
See Also:
  • Constructor Details

    • SearchFieldDTO

      public SearchFieldDTO()
      Default constructor
    • SearchFieldDTO

      public SearchFieldDTO(int colDisplayOrder, String colName, String colLabel, SearchFieldDataTypeEnum dataType, int width)
      Constructor
      Parameters:
      colDisplayOrder - the display order of the column
      colName - the name of property which is used in the select clause of the query
      colLabel - the displayed name of the column
      dataType - the data type
      width - the width of the column
    • SearchFieldDTO

      public SearchFieldDTO(SearchFieldTypeEnum type, int colDisplayOrder, String colName, String colLabel, SearchFieldDataTypeEnum dataType, int width)
      Constructor
      Parameters:
      type - the field type
      colDisplayOrder - the display order of the column
      colName - the name of property which is used in the select clause of the query
      colLabel - the displayed name of the column
      dataType - the data type
      width - the width of the column
    • SearchFieldDTO

      public SearchFieldDTO(SearchFieldTypeEnum type, int colDisplayOrder, String colName, String colLabel, SearchFieldDataTypeEnum dataType, int width, String lov)
      Constructor
      Parameters:
      type - the field type
      colDisplayOrder - the display order of the column
      colName - the name of property which is used in the select clause of the query
      colLabel - the displayed name of the column
      dataType - the data type
      width - the width of the column
      lov - the fully qualified class name of the list of values
  • Method Details

    • getListOfValues

      public String getListOfValues()
      Returns:
      the fully qualified class name of the connected list-of-values dialog
    • setListOfValues

      public void setListOfValues(String listOfValues)
      Set the fully qualified class name of the connected list-of-values dialog
      Parameters:
      listOfValues -
    • compareTo

      public int compareTo(SearchFieldDTO o)
      Specified by:
      compareTo in interface Comparable<SearchFieldDTO>
    • getColOrder

      public int getColOrder()
      Returns:
      the column order
    • setColOrder

      public void setColOrder(int colDisplayOrder)
      Set the column order
      Parameters:
      colDisplayOrder -
    • getColWidth

      public int getColWidth()
      Returns:
      the width of the column
    • setColWidth

      public void setColWidth(int colWidth)
      Set the column width
      Parameters:
      colWidth -
    • getColLabel

      public String getColLabel()
      Returns:
      the column label
    • setColLabel

      public void setColLabel(String colLabel)
      Set the column label
      Parameters:
      colLabel -
    • getColName

      public String getColName()
      Returns:
      the column name
    • setColName

      public void setColName(String colName)
      Set the column name
      Parameters:
      colName -
    • getDataType

      public SearchFieldDataTypeEnum getDataType()
      Returns:
      the column data type
    • setDataType

      public void setDataType(SearchFieldDataTypeEnum type)
      Set the data type of the column
      Parameters:
      type -
    • isVisible

      public boolean isVisible()
      Returns:
      true if the column should be visible
    • setVisible

      public void setVisible(boolean visible)
      Set the flag that controls if a column is visible
      Parameters:
      visible -
    • getFetchIndex

      public int getFetchIndex()
      Returns:
      the column fetch index
    • setFetchIndex

      public void setFetchIndex(int colIndex)
      Set the column fetch index
      Parameters:
      colIndex -
    • getOperator

      public SearchOperatorDTO getOperator()
      Returns:
      the operator
    • setOperator

      public void setOperator(SearchOperatorDTO operator)
      Set the search operator
      Parameters:
      operator -
    • getFilterCriteria

      public String getFilterCriteria()
      Returns:
      the filter criteria
    • setFilterCriteria

      public void setFilterCriteria(String filterCriteria)
      Set the filter criteria
      Parameters:
      filterCriteria -
    • getSortOrder

      public SortDirectionEnum getSortOrder()
      Returns:
      the sort order
    • setSortOrder

      public void setSortOrder(SortDirectionEnum sortOrder)
      Set the sort order
      Parameters:
      sortOrder -
    • getType

      public SearchFieldTypeEnum getType()
      Returns:
      the type of the search field
    • setType

      public void setType(SearchFieldTypeEnum type)
      Set the search field type
      Parameters:
      type -
    • getColumnIndex

      public int getColumnIndex()
      Returns:
      the column index
    • setColumnIndex

      public void setColumnIndex(int columnIndex)
      Parameters:
      columnIndex - set column index to set
    • getSortIndex

      public int getSortIndex()
      Returns:
      the sort index
    • setSortIndex

      public void setSortIndex(int sortIndex)
      Parameters:
      sortIndex -
    • getOriginalColumnIndex

      public int getOriginalColumnIndex()
      Returns:
      the original column index
    • setOriginalColumnIndex

      public void setOriginalColumnIndex(int originalColumnIndex)
      Parameters:
      originalColumnIndex -
    • getEnumListValues

      public Map<String,String> getEnumListValues()
      Returns:
      the hash map of enumeration values
    • setEnumListValues

      public void setEnumListValues(Map<String,String> enumListValues)
      Parameters:
      enumListValues - the hash map of enumeration values to set
    • getLovCommand

      public String getLovCommand()
      Returns:
      the list-of-values command string
    • setLovCommand

      public void setLovCommand(String lovCommand)
      Parameters:
      lovCommand - the list-of-values command string to set
    • isDateTimeFormat

      public boolean isDateTimeFormat()
      Returns:
      a flag that determines if a date field is of type date time or date. Fields supplied with a different type should ignore the flag!
    • setDateTimeFormat

      public void setDateTimeFormat(boolean dateTimeFormat)
      Parameters:
      dateTimeFormat - the date time format flag to set
    • hasTemporalDataType

      public boolean hasTemporalDataType()
      Returns:
      true if the data type represents a date