Class MRelationType

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, IZoomProvider, I_AD_RelationType, I_Persistent, Evaluatee

public class MRelationType extends X_AD_RelationType implements IZoomProvider
Extended model class for AD_RelationType.
Formal definition for a set of data record pairs.
Author:
Tobias Schoeneberg, www.metas.de - FR [ 2897194 ] Advanced Zoom and RelationTypes
See Also:
  • Field Details

    • SQL

      protected static final String SQL
      Selection for those relation types whose AD_Reference(s) might match a given PO. Only evaluates the table and key column of the reference's AD_Ref_Table entries.

      Warning: Doesn't support POs with more or less than one key column.

      See Also:
    • SQL_WINDOW_NAME

      protected static final String SQL_WINDOW_NAME
      See Also:
    • SQL_WINDOW_NAME_TRL

      protected static final String SQL_WINDOW_NAME_TRL
      See Also:
    • destinationRefId

      public int destinationRefId
  • Constructor Details

    • MRelationType

      public MRelationType(Properties ctx, String AD_RelationType_UU, String trxName)
      UUID based Constructor
      Parameters:
      ctx - Context
      AD_RelationType_UU - UUID key
      trxName - Transaction
    • MRelationType

      public MRelationType(Properties ctx, int AD_RelationType_ID, String trxName)
      Parameters:
      ctx -
      AD_RelationType_ID -
      trxName -
    • MRelationType

      public MRelationType(Properties ctx, ResultSet rs, String trxName)
      Parameters:
      ctx -
      rs -
      trxName -
    • MRelationType

      public MRelationType(Properties ctx, int AD_RelationType_ID, String trxName, String... virtualColumns)
      Parameters:
      ctx -
      AD_RelationType_ID -
      trxName -
      virtualColumns -
  • Method Details

    • retrieveTypes

      public static List<MRelationType> retrieveTypes(PO po, int windowId)
      Returns the types that define a relation which contains the given PO.
      Explicit types are returned even if they don't actually contain the given PO.
      Parameters:
      po -
      Returns:
      matching relation types
    • retrieveZoomInfos

      public static List<ZoomInfoFactory.ZoomInfo> retrieveZoomInfos(PO po, int windowID)
      Parameters:
      po -
      windowID -
      Returns:
      zoom info records from matching relation types
    • whereClauseMatches

      protected static boolean whereClauseMatches(PO po, String where)
      Parameters:
      po -
      where -
      Returns:
      true if where is empty or match found in DB
    • parseWhereClause

      public static String parseWhereClause(PO po, String where)
      Parameters:
      po -
      where -
      Returns:
      parsed where clause
    • checkDestinationRefId

      public void checkDestinationRefId()
      throw exception if destination reference is not valid
    • retrieveZoomInfos

      public List<ZoomInfoFactory.ZoomInfo> retrieveZoomInfos(PO po)
      Description copied from interface: IZoomProvider
      Discover zoom targets for po
      Specified by:
      retrieveZoomInfos in interface IZoomProvider
      Parameters:
      po -
      Returns:
      zoom info records from destination reference
    • retrieveWindowID

      public int retrieveWindowID(PO po, MRefTable refTable)
      Parameters:
      po -
      refTable -
      Returns:
      AD_Window_ID
    • retrieveRefTable

      public static MRefTable retrieveRefTable(Properties ctx, int referenceId, String trxName)
      Parameters:
      ctx -
      referenceId -
      trxName -
      Returns:
      MRefTable
    • retrieveDestinationTableName

      public String retrieveDestinationTableName()
      Returns:
      table name of destination reference
    • retrieveDestinationKeyColName

      public String retrieveDestinationKeyColName()
      Returns:
      key column name of destination reference
    • toString

      public String toString()
      Description copied from class: PO
      String representation
      Overrides:
      toString in class X_AD_RelationType
      Returns:
      String representation