Class MDocTypeCounter

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

public class MDocTypeCounter extends X_C_DocTypeCounter implements ImmutablePOSupport
Counter Document Type Model
Version:
$Id: MDocTypeCounter.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
Author:
Jorg Janke
See Also:
  • Constructor Details

    • MDocTypeCounter

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

      public MDocTypeCounter(Properties ctx, int C_DocTypeCounter_ID, String trxName)
      Standard Constructor
      Parameters:
      ctx - context
      C_DocTypeCounter_ID - id
      trxName - transaction
    • MDocTypeCounter

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

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

      public MDocTypeCounter(Properties ctx, MDocTypeCounter copy)
      Parameters:
      ctx -
      copy -
    • MDocTypeCounter

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

    • getCounterDocType_ID

      public static int getCounterDocType_ID(Properties ctx, int C_DocType_ID)
      Get counter document for a document type
      Parameters:
      ctx - context
      C_DocType_ID - document type to get counter document
      Returns:
      counter document C_DocType_ID or 0 or -1 if no counter doc
    • getCounterDocType

      public static MDocTypeCounter getCounterDocType(Properties ctx, int C_DocType_ID)
      Get (first) valid Counter document for document type
      Parameters:
      ctx - ignore
      C_DocType_ID - base document
      Returns:
      counter document type (may be invalid) or null
    • getCounterDocType

      public static MDocTypeCounter getCounterDocType(int C_DocType_ID)
      Get (first) valid Counter document for document type
      Parameters:
      C_DocType_ID - base document
      Returns:
      counter document type (may be invalid) or null
    • get

      public static MDocTypeCounter get(int C_DocTypeCounter_ID)
      Get MDocTypeCounter from Cache (Immutable)
      Parameters:
      C_DocTypeCounter_ID - id
      Returns:
      MDocTypeCounter
    • get

      public static MDocTypeCounter get(int C_DocTypeCounter_ID, String trxName)
      Get MDocTypeCounter from Cache (Immutable)
      Parameters:
      C_DocTypeCounter_ID - id
      trxName - transaction
      Returns:
      MDocTypeCounter
    • get

      public static MDocTypeCounter get(Properties ctx, int C_DocTypeCounter_ID, String trxName)
      Get MDocTypeCounter from Cache (Immutable)
      Parameters:
      ctx - context
      C_DocTypeCounter_ID - id
      trxName -
      Returns:
      MDocTypeCounter
    • getCounterDocBaseType

      public static String getCounterDocBaseType(String DocBaseType)
      Get Counter Document BaseType
      Parameters:
      DocBaseType - Document Base Type (e.g. SOO) to get counter document base type
      Returns:
      Counter Document BaseType (e.g. POO) or null if there is none
    • setC_DocType_ID

      public void setC_DocType_ID(int C_DocType_ID)
      Set C_DocType_ID. Reset IsValid to false.
      Specified by:
      setC_DocType_ID in interface I_C_DocTypeCounter
      Overrides:
      setC_DocType_ID in class X_C_DocTypeCounter
      Parameters:
      C_DocType_ID - id
    • setCounter_C_DocType_ID

      public void setCounter_C_DocType_ID(int Counter_C_DocType_ID)
      Set Counter C_DocType_ID. Reset IsValid to false.
      Specified by:
      setCounter_C_DocType_ID in interface I_C_DocTypeCounter
      Overrides:
      setCounter_C_DocType_ID in class X_C_DocTypeCounter
      Parameters:
      Counter_C_DocType_ID - id
    • getDocType

      public MDocType getDocType()
      Get Doc Type (immutable)
      Returns:
      doc type or null if not existing
    • getCounterDocType

      public MDocType getCounterDocType()
      Get Counter Doc Type (immutable)
      Returns:
      counter doc type or null if not existing
    • validate

      public String validate()
      Validate Document Type compatibility and update IsValid flag accordingly.
      Returns:
      Error message or null if valid
    • toString

      public String toString()
      String Representation
      Overrides:
      toString in class X_C_DocTypeCounter
      Returns:
      info
    • beforeSave

      protected boolean beforeSave(boolean newRecord)
      Description copied from class: PO
      Called before Save for Pre-Save Operation.
      Default implementation is nop, to be implemented in sub-classes that needed it.
      Overrides:
      beforeSave in class PO
      Parameters:
      newRecord - true if it is a new record
      Returns:
      true if record can be saved
    • markImmutable

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