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; }
public boolean deleteById(long id) { return bookingStore.delete(USER_BEAN + ":" + id); }
public User update(User user) { Object updatedUser = bookingStore.update(USER_BEAN + ":" + user.getId(), user); return nonNull(updatedUser) ? (User) updatedUser : null; }
public User insert(User user) { Object insertedUser = bookingStore.create(USER_BEAN, user); return nonNull(insertedUser) ? (User) insertedUser : null; }
public User selectById(long id) { Object readUser = bookingStore.read(USER_BEAN + ":" + id); return nonNull(readUser) ? (User) readUser : null; }