IDEMPIERE-5996 - Added the functionality of resetting cache after cre… (#2186)
* IDEMPIERE-5996 - Added the functionality of resetting cache after creating a record access restriction * Update MRecordAccess.java --------- Co-authored-by: Carlos Ruiz <carg67@gmail.com>
This commit is contained in:
parent
63823f3a40
commit
735a735fbb
|
@ -21,6 +21,8 @@ import java.sql.ResultSet;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import org.compiere.Adempiere;
|
||||||
|
import org.compiere.util.CacheMgt;
|
||||||
import org.compiere.util.DB;
|
import org.compiere.util.DB;
|
||||||
import org.compiere.util.Msg;
|
import org.compiere.util.Msg;
|
||||||
|
|
||||||
|
@ -33,20 +35,20 @@ import org.compiere.util.Msg;
|
||||||
public class MRecordAccess extends X_AD_Record_Access
|
public class MRecordAccess extends X_AD_Record_Access
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* generated serial id
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = -5115765616266528435L;
|
private static final long serialVersionUID = -3608241027957009608L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UUID based Constructor
|
||||||
|
* @param ctx Context
|
||||||
|
* @param AD_Record_Access_UU UUID key
|
||||||
|
* @param trxName Transaction
|
||||||
|
*/
|
||||||
|
public MRecordAccess(Properties ctx, String AD_Record_Access_UU, String trxName) {
|
||||||
|
super(ctx, AD_Record_Access_UU, trxName);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* UUID based Constructor
|
|
||||||
* @param ctx Context
|
|
||||||
* @param AD_Record_Access_UU UUID key
|
|
||||||
* @param trxName Transaction
|
|
||||||
*/
|
|
||||||
public MRecordAccess(Properties ctx, String AD_Record_Access_UU, String trxName) {
|
|
||||||
super(ctx, AD_Record_Access_UU, trxName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ctx context
|
* @param ctx context
|
||||||
* @param ignored ignored
|
* @param ignored ignored
|
||||||
|
@ -287,5 +289,21 @@ public class MRecordAccess extends X_AD_Record_Access
|
||||||
}
|
}
|
||||||
return m_tableName;
|
return m_tableName;
|
||||||
} // getTableName
|
} // getTableName
|
||||||
|
|
||||||
|
/**
|
||||||
|
* After Save
|
||||||
|
* @param newRecord new
|
||||||
|
* @param success success
|
||||||
|
* @return success
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected boolean afterSave(boolean newRecord, boolean success) {
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
|
|
||||||
|
Adempiere.getThreadPoolExecutor().submit(() -> CacheMgt.get().reset(MRole.Table_Name, getAD_Role_ID()));
|
||||||
|
|
||||||
|
return success;
|
||||||
|
} // afterSave
|
||||||
|
|
||||||
} // MRecordAccess
|
} // MRecordAccess
|
||||||
|
|
Loading…
Reference in New Issue