Package org.apache.webbeans.reservation.entity

Examples of org.apache.webbeans.reservation.entity.User


        System.out.println("Pre Destroy Construct Sample .... " + UserController.class.getName() + " is destroyed by the container");
    }
   
    public User getUser(int id)
    {
        User user = this.entityManager.find(User.class, id);
       
        return user;
    }
View Full Code Here


    @Transactional
    public void updateUserInfo(int userId, String name, String surname, int age, String userName, String password)
    {
        logger.debug("Updating user with id : " + userId);
       
        User user = this.entityManager.find(User.class, userId);
       
        user.setName(name);
        user.setSurname(surname);
        user.setAge(age);
        user.setUserName(userName);
        user.setPassword(password);
    }
View Full Code Here

    }
   
    @Transactional
    public void addReservation(Map<String, ReservationModel> reservations, int userId)
    {
        User user = this.entityManager.find(User.class, userId);
       
        Set<String> keys = reservations.keySet();
       
        for(String item : keys)
        {
            ReservationModel rm = reservations.get(item);
            SelectItem si = rm.getItem();
            Hotel hotel = this.entityManager.find(Hotel.class, si.getValue());
           
            Reservation reservation = new Reservation();
           
            user.addHotel(reservation);
           
            reservation.setHotel(hotel);
            reservation.setReservationDate(rm.getDate());
           
            this.entityManager.persist(reservation);           
View Full Code Here

   
    @Transactional
    public void deleteReservation(int reservsitonId)
    {
        Reservation res = this.entityManager.find(Reservation.class, reservsitonId);
        User user = res.getUser();
       
        user.getReservations().remove(res);
       
        this.entityManager.remove(res);
    }
View Full Code Here

        this.entityManager.remove(res);
    }
   
    public List<Reservation> getReservations(int id)
    {
        User user = this.entityManager.find(User.class, id);
       
        Set<Reservation> res = user.getReservations();
       
        List<Reservation> l = new ArrayList<Reservation>();
        for(Reservation r : res)
        {
            l.add(r);
View Full Code Here

       
    }

    public String getReservations()
    {
        User user = (User) model.getRowData();
       
        Set<Hotel> set  = this.controller.getReservationsWithUser(user.getId());
        for(Hotel hotel : set)
        {
            hotels.add(hotel);
        }
       
View Full Code Here

                                            "p.password=:password");
       
        query.setParameter("userName", userName);
        query.setParameter("password", password);
       
        User value = null;
        try
        {
            value =(User)query.getSingleResult();
            value.setLastLoginDate(GregorianCalendar.getInstance().getTime());
        }
        catch(Exception e)
        {
            return null;
        }
View Full Code Here

        System.out.println("Pre Destroy Construct Sample .... " + UserController.class.getName() + " is destroyed by the container");
    }
   
    public User getUser(int id)
    {
        User user = this.entityManager.find(User.class, id);
       
        return user;
    }
View Full Code Here

    @Transactional
    public void updateUserInfo(int userId, String name, String surname, int age, String userName, String password)
    {
        logger.debug("Updating user with id : " + userId);
       
        User user = this.entityManager.find(User.class, userId);
       
        user.setName(name);
        user.setSurname(surname);
        user.setAge(age);
        user.setUserName(userName);
        user.setPassword(password);
    }
View Full Code Here

    }
   
    @Transactional
    public void addReservation(Map<String, ReservationModel> reservations, int userId)
    {
        User user = this.entityManager.find(User.class, userId);
       
        Set<String> keys = reservations.keySet();
       
        for(String item : keys)
        {
            ReservationModel rm = reservations.get(item);
            SelectItem si = rm.getItem();
            Hotel hotel = this.entityManager.find(Hotel.class, si.getValue());
           
            Reservation reservation = new Reservation();
           
            user.addHotel(reservation);
           
            reservation.setHotel(hotel);
            reservation.setReservationDate(rm.getDate());
           
            this.entityManager.persist(reservation);           
View Full Code Here

TOP

Related Classes of org.apache.webbeans.reservation.entity.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.