Class ViewType

All Implemented Interfaces:
Serializable, Comparable

public class ViewType extends ComposedType
Represents the funtionality of a 'SQL-View'. Visit wiki.hybris.de for more informations.
See Also:
  • Field Details

  • Constructor Details

    • ViewType

      public ViewType()
  • Method Details

    • createItem

      protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
      Description copied from class: ComposedType
      The generic creator method for creating new composed types by ComposedType.newInstance(Map).

      Required attributes are:

      Overrides:
      createItem in class ComposedType
      Parameters:
      ctx - the current session context which this item is created within
      type - the actual item type ( since subtypes may not provide a own jalo class this may be different from the type which this method was implemented for )
      Returns:
      the new item instance
      Throws:
      JaloBusinessException - indicates an error during creation - any changes will be rollbacked
    • getJaloClass

      public Class getJaloClass()
      Redefined to return ViewResultItem class.
      Overrides:
      getJaloClass in class ComposedType
      Returns:
      the jalo class object of the item defined by this type. if this type doesnt have a own jalo class the supertype is used.
    • isAbstract

      public boolean isAbstract()
      redefined to return true always.
      Overrides:
      isAbstract in class ComposedType
      Returns:
      true if the type cannot have instances.
    • toString

      public String toString(SessionContext ctx, Object value) throws JaloInvalidParameterException
      Overrides:
      toString in class ComposedType
      Throws:
      JaloInvalidParameterException
      Since:
      2.10
    • parseValue

      public Object parseValue(SessionContext ctx, String value) throws JaloInvalidParameterException
      Overrides:
      parseValue in class ComposedType
      Throws:
      JaloInvalidParameterException
      Since:
      2.10
    • getQuery

      public String getQuery()
      Returns:
      the flexible search query which defines the instances of this view type
    • setQuery

      public void setQuery(String q)
      Changes the flexible search query of this view type.

      Please make sure that the amount and oder of the column and param attribute descriptors of this type still match the query!

      Parameters:
      q - the new query - must not be null
    • setParamAttributeDescriptors

      protected void setParamAttributeDescriptors(Set params)
      Changes the current param attribute descriptor set. All previous attribute descriptors which are not contained in the new set are removed.
      Parameters:
      params - the new set of param attribute descriptors
    • getParamAttributeDescriptors

      public Set getParamAttributeDescriptors()
      Returns:
      a set of all attribute descriptors which describe query params for this view type
    • setColumnAttributeDescriptors

      protected void setColumnAttributeDescriptors(List cols)
      Changes the current column attribute descriptor list. All previous attribute descriptors which are not contained in the new set are removed. The list order must match the query SELECT order!
      Parameters:
      cols - the new list of column attribute descriptors
    • getColumnAttributeDescriptors

      public List getColumnAttributeDescriptors()
      Returns:
      a set of all attribute descriptors which describe query params for this view type
    • getResultRowSignature

      protected List getResultRowSignature(List resultRowAttributes)
    • createAttributeMapFromRow

      protected Map createAttributeMapFromRow(List resultAttributes, List rowData)
    • convertGenericValueConditions

      public Map convertGenericValueConditions(GenericCondition cond)
      Since:
      2.10
    • search

      public SearchResult search(Map values, boolean dontNeedTotal, int start, int count)
    • search

      public SearchResult search(SessionContext ctx, Map values, boolean dontNeedTotal, int start, int count)
    • getXMLCustomProperties

      protected Map getXMLCustomProperties(String forExtension)
      Exports its query as XML custom properties.
      Overrides:
      getXMLCustomProperties in class ComposedType