Class MResource

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

public class MResource extends X_S_Resource implements ImmutablePOSupport
Resource Model
Version:
$Id: MResource.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $
Author:
Jorg Janke, Teo Sarca, www.arhipac.ro
  • FR [ 2051056 ] MResource[Type] should be cached
  • BF [ 2227901 ] MRP (Calculate Material Plan) fails if resource is empty
  • BF [ 2824795 ] Deleting Resource product should be forbidden https://sourceforge.net/p/adempiere/bugs/1988/
  • See Also:
    • Constructor Details

      • MResource

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

        public MResource(Properties ctx, int S_Resource_ID, String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        S_Resource_ID - id
        trxName -
      • MResource

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

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

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

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

      • get

        public static MResource get(int S_Resource_ID)
        Get from Cache (immutable)
        Parameters:
        S_Resource_ID -
        Returns:
        MResource
      • get

        public static MResource get(Properties ctx, int S_Resource_ID)
        Get from Cache (immutable)
        Parameters:
        ctx -
        S_Resource_ID -
        Returns:
        MResource
      • getCopy

        public static MResource getCopy(Properties ctx, int S_Resource_ID, String trxName)
        Get updateable copy of MResource from cache
        Parameters:
        ctx -
        S_Resource_ID -
        trxName -
        Returns:
        MResource
      • getResourceType

        public MResourceType getResourceType()
        Get cached Resource Type
        Returns:
        Resource Type
      • getProduct

        public MProduct getProduct()
        Get Product (use cache)
        Returns:
        product
      • getC_UOM_ID

        public int getC_UOM_ID()
        Returns:
        product C_UOM_ID
      • 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
      • afterSave

        protected boolean afterSave(boolean newRecord, boolean success)
        Description copied from class: PO
        Called after Save for Post-Save Operation.
        Default implementation is nop, to be implemented in sub-classes that needed it.
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - true if it is a new record
        success - true if save operation was success
        Returns:
        if save was a success
      • beforeDelete

        protected boolean beforeDelete()
        Description copied from class: PO
        Execute before Delete operations.
        Default implementation is nop, to be implemented in sub-classes that needed it.
        Overrides:
        beforeDelete in class PO
        Returns:
        true if record can be deleted
      • markImmutable

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

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