Package dbbeans

Examples of dbbeans.Roles


     * @throws Exception
     */
    @Override
    public String execute() throws Exception {
        Users user;
        Roles role;
        if (!checkIfRoleExists("webuser")) {
            createRole("webuser", "Web-site users role");
        }
        try {
            DBInitializer.tranxBegin();
View Full Code Here


        }
        return (true);
    }

    private void createRole(String role1, String description) {
        Roles role = new Roles();
        role.setIdroles(role1);
        role.setDescription(description);
        try {
            DBInitializer.persist(role);
        } catch (Exception e) {
            logger.log(Level.SEVERE, "Role: " + role1 +" role creation failed. "+e.getMessage());           
        }
View Full Code Here

        logger.log(Level.INFO, "User Role List: {0}", user.getRolesList().listIterator().next().toString());
        return user;
    }

    private Roles updateRoleEntityRelationship(String rolename, Users user) throws Exception {
        Roles role=null;
        List<Roles> webUserRoleList = null;
        List<Users> roleRelatedUserList = null;
        webUserRoleList = DBInitializer.getRoleByID(rolename);
        role = (Roles) webUserRoleList.listIterator().next();
        roleRelatedUserList = role.getUsersList();
        roleRelatedUserList.add(user);
        role.setUsersList(roleRelatedUserList);
        return role;
    }
View Full Code Here

TOP

Related Classes of dbbeans.Roles

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.