Example #1
0
  public List<User> selectAll() {
    List<Object> objectList = bookingStore.readAll(USER_BEAN);
    List<User> eventList = new ArrayList<>();

    objectList.stream().filter(elt -> elt != null).forEach(elt -> eventList.add(castToUser(elt)));

    return eventList;
  }
Example #2
0
 public boolean deleteById(long id) {
   return bookingStore.delete(USER_BEAN + ":" + id);
 }
Example #3
0
 public User update(User user) {
   Object updatedUser = bookingStore.update(USER_BEAN + ":" + user.getId(), user);
   return nonNull(updatedUser) ? (User) updatedUser : null;
 }
Example #4
0
 public User insert(User user) {
   Object insertedUser = bookingStore.create(USER_BEAN, user);
   return nonNull(insertedUser) ? (User) insertedUser : null;
 }
Example #5
0
 public User selectById(long id) {
   Object readUser = bookingStore.read(USER_BEAN + ":" + id);
   return nonNull(readUser) ? (User) readUser : null;
 }