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