BF [ 1826279 ] MPackageExpCommon.afterSave: bad implementation

* javadoc fixes, initial author is Rob Klein and not Jorg Janke
This commit is contained in:
teo_sarca 2007-11-05 19:19:09 +00:00
parent 0ad23fb22b
commit 9657819e1d
1 changed files with 21 additions and 25 deletions

View File

@ -17,15 +17,17 @@
*****************************************************************************/ *****************************************************************************/
package org.compiere.model; package org.compiere.model;
import java.sql.*; import java.sql.ResultSet;
import java.util.*; import java.util.Properties;
import org.compiere.util.*;
import org.compiere.util.DB;
/** /**
* Menu Model * Package Export Commons
* *
* @author Jorg Janke * @author Rob Klein
* @version $Id: MMenu.java,v 1.5 2005/05/14 05:32:16 jjanke Exp $ * @author Teo Sarca, SC ARHIPAC SERVICE SRL
* <li>BF [ 1826279 ] MPackageExpCommon.afterSave: bad implementation
*/ */
public class MPackageExpCommon extends X_AD_Package_Exp_Common public class MPackageExpCommon extends X_AD_Package_Exp_Common
{ {
@ -53,24 +55,18 @@ public class MPackageExpCommon extends X_AD_Package_Exp_Common
} // MPackageExp } // MPackageExp
/** /* (non-Javadoc)
* After Save * @see org.compiere.model.PO#beforeSave(boolean)
* @param newRecord new
* @param success success
* @return success
*/ */
protected boolean afterSave (boolean newRecord, boolean success) @Override
{ protected boolean beforeSave(boolean newRecord) {
if (getLine() == 0) {
X_AD_Package_Exp_Common PackCommon =new X_AD_Package_Exp_Common(Env.getCtx(), getAD_Package_Exp_Common_ID(), null); String sql = "SELECT max(Line) FROM AD_Package_Exp_Common"
String sql = "SELECT max(Line) FROM AD_Package_Exp_Common"; + " WHERE AD_Package_Exp_Common_ID<>?";
int lineNo = DB.getSQLValue(null, sql); int lineNo = DB.getSQLValue(get_TrxName(), sql, getAD_Package_Exp_Common_ID());
if (lineNo >= 0)
if(PackCommon.getLine()==0){ setLine(lineNo+10);
PackCommon.setLine(lineNo+10); }
PackCommon.save();}
return true; return true;
} // afterSave }
} // MPackageExpCommon
} // MMenu