Package eu.scape_project.planning.model

Examples of eu.scape_project.planning.model.UserGroup


        }

        List<User> users = em.createQuery("SELECT u FROM User u WHERE u.userGroup = :changedGroup", User.class)
            .setParameter("changedGroup", group).getResultList();
        for (User user : users) {
            UserGroup newGroup = new UserGroup();
            newGroup.setName(user.getUsername());
            em.merge(user);
        }

        em.remove(em.merge(group));
    }
View Full Code Here


    /**
     * Removes the provided user from the group of the current user.
     */
    public void removeUser(User user) {
        UserGroup group = new UserGroup();
        group.setName(user.getUsername());

        groupUsers.remove(user);

        switchGroup(user, group);
    }
View Full Code Here

    /**
     * Method responsible for saving the made changes.
     */
    public void save() {
        UserGroup group = user.getUserGroup();

        log.info("size=" + group.getPolicies().size());
        user.setUserGroup(em.merge(group));

        log.info("Policies saved for user " + user.getUsername());
    }
View Full Code Here

    /**
     * Method responsible for discarding the made changes.
     */
    public void discard() {
        UserGroup oldUserGroup = em.find(UserGroup.class, user.getUserGroup().getId());
        user.setUserGroup(oldUserGroup);

        log.info("Policies discarded for user " + user.getUsername());
    }
View Full Code Here

    } catch (Exception e) {
      existingUser = null;
    }
   
    if (existingUser == null) {
      UserGroup userGroup = new UserGroup();
      userGroup.setName("UT Vienna");
      em.persist(userGroup);
     
      User user = new User();
      user.setUsername("admin");
      user.setFirstName("admin");
View Full Code Here

    }

    private User createUser(String username) {
        User user = new User();
        user.setUsername(username);
        UserGroup userGroup = new UserGroup();
        userGroup.setName(username);
        user.setUserGroup(userGroup);
        em.persist(userGroup);
        em.persist(user);
        return user;
    }
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.model.UserGroup

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.