Class MMeasureCalc

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_PA_MeasureCalc, I_Persistent, Evaluatee, ImmutablePOSupport

public class MMeasureCalc extends X_PA_MeasureCalc implements ImmutablePOSupport
Performance Measure Calculation
Version:
$Id: MMeasureCalc.java,v 1.4 2006/09/25 00:59:41 jjanke Exp $
Author:
Jorg Janke
See Also:
  • Constructor Details

    • MMeasureCalc

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

      public MMeasureCalc(Properties ctx, int PA_MeasureCalc_ID, String trxName)
      Standard Constructor
      Parameters:
      ctx - context
      PA_MeasureCalc_ID - id
      trxName - trx
    • MMeasureCalc

      public MMeasureCalc(Properties ctx, ResultSet rs, String trxName)
      Load Constructor
      Parameters:
      ctx - context
      rs - result set
      trxName - trx
    • MMeasureCalc

      public MMeasureCalc(MMeasureCalc copy)
      Copy constructor
      Parameters:
      copy -
    • MMeasureCalc

      public MMeasureCalc(Properties ctx, MMeasureCalc copy)
      Copy constructor
      Parameters:
      ctx -
      copy -
    • MMeasureCalc

      public MMeasureCalc(Properties ctx, MMeasureCalc copy, String trxName)
      Copy constructor
      Parameters:
      ctx -
      copy -
      trxName -
  • Method Details

    • get

      public static MMeasureCalc get(int PA_MeasureCalc_ID)
      Get MMeasureCalc from Cache (immutable)
      Parameters:
      PA_MeasureCalc_ID - id
      Returns:
      MMeasureCalc
    • get

      public static MMeasureCalc get(Properties ctx, int PA_MeasureCalc_ID)
      Get MMeasureCalc from Cache (immutable)
      Parameters:
      ctx - context
      PA_MeasureCalc_ID - id
      Returns:
      MMeasureCalc
    • getSqlPI

      public String getSqlPI(MGoalRestriction[] restrictions, String MeasureScope, String MeasureDataType, Timestamp reportDate, MRole role)
      Get SQL to return single value for the Performance Indicator
      Parameters:
      restrictions - array of goal restrictions
      MeasureScope - scope of this value
      MeasureDataType - data type
      reportDate - optional report date
      role - role
      Returns:
      sql for performance indicator
    • getSqlBarChart

      public String getSqlBarChart(MGoalRestriction[] restrictions, String MeasureDisplay, Timestamp startDate, MRole role)
      Get SQL to retrieve value for bar chart
      Parameters:
      restrictions - array of goal restrictions
      MeasureDisplay - scope of this value
      startDate - optional report start date
      role - role
      Returns:
      sql for Bar Chart
    • getQuery

      public MQuery getQuery(MGoalRestriction[] restrictions, String MeasureDisplay, Timestamp date, MRole role)
      Get Zoom Query
      Parameters:
      restrictions - restrictions
      MeasureDisplay - measure display type (MGoal.MEASUREDISPLAY_*)
      date - date
      role - role
      Returns:
      query
    • addRestrictions

      public static String addRestrictions(String sql, boolean queryOnly, MGoalRestriction[] restrictions, MRole role, String tableName, String orgColumn, String bpColumn, String pColumn)
      Add Restrictions to SQL
      Parameters:
      sql - existing sql
      queryOnly - if true, don't add role access SQL clause
      restrictions - restrictions
      role - role
      tableName - table name
      orgColumn - organization column
      bpColumn - bpartner column
      pColumn - product column
      Returns:
      updated sql
    • getTableName

      public String getTableName()
      Get Table Name
      Returns:
      Table Name
    • toString

      public String toString()
      String Representation
      Overrides:
      toString in class X_PA_MeasureCalc
      Returns:
      info
    • markImmutable

      public MMeasureCalc markImmutable()
      Description copied from interface: ImmutablePOSupport
      mark PO as immutable
      Specified by:
      markImmutable in interface ImmutablePOSupport
      Returns:
      PO
    • getWhereClause

      public String getWhereClause()
      Get where clause, add WHERE keyword if where clause not started with it
      Specified by:
      getWhereClause in interface I_PA_MeasureCalc
      Overrides:
      getWhereClause in class X_PA_MeasureCalc
      Returns:
      where clause with "WHERE " keyword