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 List<Aphorism> getAllAphorism() { return aphorismDao.getObjListByCondition("1=1"); }