public void saveOnNotExist(Commodity2propertyitem entity) { List<Commodity2propertyitem> s2p = commodity2propertyitemDao.query( entity.getCommodity().getId(), entity.getPropertyitem().getId()); if (s2p == null || s2p.isEmpty()) { commodity2propertyitemDao.saveOrUpdate(entity); } }
public void delete(Commodity2propertyitem entity) { List<Commodity2propertyitem> s2ps = commodity2propertyitemDao.query( entity.getCommodity().getId(), entity.getPropertyitem().getId()); if (s2ps != null && !s2ps.isEmpty()) { for (Commodity2propertyitem s2p : s2ps) { commodity2propertyitemDao.delete(s2p); } } }