public Aphorism getAphorismRandom() { List<Aphorism> aphorisms = aphorismDao.getObjListByCondition("obj.state = 0 or obj.state is NULL"); Random random = new Random(); if (aphorisms != null && aphorisms.size() > 0) { return aphorisms.get(random.nextInt(aphorisms.size())); } else { return null; } }
public void updateAphorism(Aphorism aphorism) { aphorismDao.update(aphorism, true); }
public void saveAphorism(Aphorism aphorism) { aphorismDao.save(aphorism); }
public Aphorism getAphorismById(Long id) { return aphorismDao.getObjById(id); }
public PageInfo getAphorismListPaged(PageInfo pageInfo) { return aphorismDao.getObjListPaged(pageInfo); }
public List<Aphorism> getAllAphorism() { return aphorismDao.getObjListByCondition("1=1"); }