details: /erp/devel/pi/rev/419a4aedd233 changeset: 6779:419a4aedd233 user: Adrián Romero <adrianromero <at> openbravo.com> date: Mon Mar 22 18:59:51 2010 +0100 summary: Fixes issue 0012693: Review on delete triggers
diffstat: src-db/database/model/triggers/C_BPARTNER_TRG.xml | 6 +-- src-db/database/model/triggers/C_BPARTNER_TRG2.xml | 43 ++++++++++++++++++++++ src-db/database/model/triggers/M_PRODUCT_TRG.xml | 5 +-- src-db/database/model/triggers/M_PRODUCT_TRG2.xml | 38 +++++++++++++++++++ 4 files changed, 84 insertions(+), 8 deletions(-) diffs (139 lines): diff -r 49bda7d3d580 -r 419a4aedd233 src-db/database/model/triggers/C_BPARTNER_TRG.xml --- a/src-db/database/model/triggers/C_BPARTNER_TRG.xml Mon Mar 22 17:50:35 2010 +0100 +++ b/src-db/database/model/triggers/C_BPARTNER_TRG.xml Mon Mar 22 18:59:51 2010 +0100 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <database name="TRIGGER C_BPARTNER_TRG"> - <trigger name="C_BPARTNER_TRG" table="C_BPARTNER" fires="after" insert="true" update="true" delete="true" foreach="row"> + <trigger name="C_BPARTNER_TRG" table="C_BPARTNER" fires="after" insert="true" update="true" delete="false" foreach="row"> <body><![CDATA[ /************************************************************************* * The contents of this file are subject to the Compiere Public @@ -17,7 +17,7 @@ * parts created by ComPiere are Copyright (C) ComPiere, Inc.; * All Rights Reserved. * Contributor(s): Openbravo SLU - * Contributions are Copyright (C) 2001-2008 Openbravo, S.L.U. + * Contributions are Copyright (C) 2001-2010 Openbravo, S.L.U. * * Specifically, this derivative work is based upon the following Compiere * file and version. @@ -267,8 +267,6 @@ WHERE C_BPARTNER_ID = :new.C_BPartner_ID; UPDATE C_BP_EMPLOYEE_ACCT SET AD_ORG_ID = :new.AD_Org_ID WHERE C_BPARTNER_ID = :new.C_BPartner_ID; - ELSIF (DELETING) THEN - DELETE FROM AD_TreeNodeBP WHERE AD_Client_ID = :old.AD_Client_ID AND Node_ID = :old.C_BPartner_ID; END IF; EXCEPTION WHEN NO_DATA_FOUND THEN diff -r 49bda7d3d580 -r 419a4aedd233 src-db/database/model/triggers/C_BPARTNER_TRG2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src-db/database/model/triggers/C_BPARTNER_TRG2.xml Mon Mar 22 18:59:51 2010 +0100 @@ -0,0 +1,43 @@ +<?xml version="1.0"?> + <database name="TRIGGER C_BPARTNER_TRG2"> + <trigger name="C_BPARTNER_TRG2" table="C_BPARTNER" fires="before" insert="false" update="false" delete="true" foreach="row"> + <body><![CDATA[ + /************************************************************************* + * The contents of this file are subject to the Compiere Public + * License 1.1 ("License"); You may not use this file except in + * compliance with the License. You may obtain a copy of the License in + * the legal folder of your Openbravo installation. + * Software distributed under the License is distributed on an + * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing rights + * and limitations under the License. + * The Original Code is Compiere ERP & Business Solution + * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc. + * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, + * parts created by ComPiere are Copyright (C) ComPiere, Inc.; + * All Rights Reserved. + * Contributor(s): Openbravo SLU + * Contributions are Copyright (C) 2001-2010 Openbravo, S.L.U. + * + * Specifically, this derivative work is based upon the following Compiere + * file and version. + ************************************************************************* + * $Id: C_BPartner_Trg2.sql,v 1.4 2002/10/23 03:16:57 jjanke Exp $ + *** + * Title: Business Partner delete necord + * Description: + ************************************************************************/ + +BEGIN + + IF AD_isTriggerEnabled()='N' THEN + RETURN OLD; + END IF; + + DELETE FROM AD_TreeNodeBP WHERE AD_Client_ID = :old.AD_Client_ID AND Node_ID = :old.C_BPartner_ID; + RETURN OLD; + +END C_BPARTNER_TRG2 +]]></body> + </trigger> + </database> diff -r 49bda7d3d580 -r 419a4aedd233 src-db/database/model/triggers/M_PRODUCT_TRG.xml --- a/src-db/database/model/triggers/M_PRODUCT_TRG.xml Mon Mar 22 17:50:35 2010 +0100 +++ b/src-db/database/model/triggers/M_PRODUCT_TRG.xml Mon Mar 22 18:59:51 2010 +0100 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <database name="TRIGGER M_PRODUCT_TRG"> - <trigger name="M_PRODUCT_TRG" table="M_PRODUCT" fires="after" insert="true" update="true" delete="true" foreach="row"> + <trigger name="M_PRODUCT_TRG" table="M_PRODUCT" fires="after" insert="true" update="true" delete="false" foreach="row"> <body><![CDATA[ /************************************************************************* * The contents of this file are subject to the Compiere Public @@ -190,9 +190,6 @@ :new.IsActive, :new.Created, :new.CreatedBy, :new.Updated, :new.UpdatedBy, v_xTree_ID, :new.M_Product_ID, v_xParent_ID, (CASE :new.IsSummary WHEN 'Y' THEN 100 ELSE 999 END)); -- Summary Nodes first - - ELSIF (DELETING) THEN - DELETE FROM AD_TreeNodePR WHERE AD_Client_ID = :old.AD_Client_ID AND Node_ID = :old.M_Product_ID; END IF; IF (INSERTING OR UPDATING) THEN -- Checks on the attribute set value diff -r 49bda7d3d580 -r 419a4aedd233 src-db/database/model/triggers/M_PRODUCT_TRG2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src-db/database/model/triggers/M_PRODUCT_TRG2.xml Mon Mar 22 18:59:51 2010 +0100 @@ -0,0 +1,38 @@ +<?xml version="1.0"?> + <database name="TRIGGER M_PRODUCT_TRG2"> + <trigger name="M_PRODUCT_TRG2" table="M_PRODUCT" fires="before" insert="false" update="false" delete="true" foreach="row"> + <body><![CDATA[ +/************************************************************************* + * The contents of this file are subject to the Compiere Public + * License 1.1 ("License"); You may not use this file except in + * compliance with the License. You may obtain a copy of the License in + * the legal folder of your Openbravo installation. + * Software distributed under the License is distributed on an + * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing rights + * and limitations under the License. + * The Original Code is Compiere ERP & Business Solution + * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc. + * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, + * parts created by ComPiere are Copyright (C) ComPiere, Inc.; + * All Rights Reserved. + * Contributor(s): Openbravo SLU + * Contributions are Copyright (C) 2001-2010 Openbravo, S.L.U. + * + * Specifically, this derivative work is based upon the following Compiere + * file and version. + *************************************************************************/ + +BEGIN + IF AD_isTriggerEnabled()='N' THEN + RETURN OLD; + END IF; + + DELETE FROM AD_TreeNodePR WHERE AD_Client_ID = :old.AD_Client_ID AND Node_ID = :old.M_Product_ID; + + RETURN OLD; + +END M_PRODUCT_TRG2 +]]></body> + </trigger> + </database> ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits