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 void updateAphorism(Aphorism aphorism) {
   aphorismDao.update(aphorism, true);
 }
Beispiel #3
0
 public void saveAphorism(Aphorism aphorism) {
   aphorismDao.save(aphorism);
 }
Beispiel #4
0
 public Aphorism getAphorismById(Long id) {
   return aphorismDao.getObjById(id);
 }
Beispiel #5
0
 public PageInfo getAphorismListPaged(PageInfo pageInfo) {
   return aphorismDao.getObjListPaged(pageInfo);
 }
Beispiel #6
0
 public List<Aphorism> getAllAphorism() {
   return aphorismDao.getObjListByCondition("1=1");
 }