Example #1
0
 /**
  * Parent Constructor
  *
  * @param resource parent
  * @param resourceType resource type
  */
 public MProduct(MResource resource, MResourceType resourceType) {
   this(resource.getCtx(), 0, resource.get_TrxName());
   setAD_Org_ID(resource.getAD_Org_ID());
   setProductType(X_M_Product.PRODUCTTYPE_Resource);
   setResource(resource);
   setResource(resourceType);
 } //	MProduct
Example #2
0
 /**
  * Set Resource
  *
  * @param parent resource
  * @return true if changed
  */
 public boolean setResource(MResource parent) {
   boolean changed = false;
   if (!PRODUCTTYPE_Resource.equals(getProductType())) {
     setProductType(PRODUCTTYPE_Resource);
     changed = true;
   }
   if (parent.getS_Resource_ID() != getS_Resource_ID()) {
     setS_Resource_ID(parent.getS_Resource_ID());
     changed = true;
   }
   if (parent.isActive() != isActive()) {
     setIsActive(parent.isActive());
     changed = true;
   }
   //
   if (!parent.getValue().equals(getValue())) {
     setValue(parent.getValue());
     changed = true;
   }
   if (!parent.getName().equals(getName())) {
     setName(parent.getName());
     changed = true;
   }
   if ((parent.getDescription() == null && getDescription() != null)
       || (parent.getDescription() != null && !parent.getDescription().equals(getDescription()))) {
     setDescription(parent.getDescription());
     changed = true;
   }
   //
   return changed;
 } //	setResource