/** * validate before update. * * @param g */ public static boolean update(Goods g) { return BaseValidator.gtZero(g.getId()) && Strings.isNotBlank(g.getCateCode()) && Strings.isNotBlank(g.getGname()) && (Goods.STATE_OK.equals(g.getState()) || Goods.STATE_RM.equals(g.getState())); }
/** * validate before save. * * @param g */ public static boolean insert(Goods g) { return g.getId() <= 0 && Strings.isNotBlank(g.getCateCode()) && Strings.isNotBlank(g.getGname()) && (Goods.STATE_OK.equals(g.getState()) || Goods.STATE_RM.equals(g.getState())); }