Package eu.lsem.bakalarka.model

Examples of eu.lsem.bakalarka.model.User


     * @return
     */
    public Resolution save() {
        String encodedPassword = passwordEncoder.encodePassword(password, applicationConfiguration.getSystemWideSalt());
        if (id == null) {
            User u = new User();
            u.setUsername(username);
            u.setPassword(encodedPassword);
            u.setEnabled(false);
            u.setLastLogin(null);
            List<String> roles = new LinkedList<String>();
            roles.add("ROLE_ADMIN");
            u.setRoles(roles);

            try {
                userDao.insertUser(u);
            } catch (DataIntegrityViolationException e) {
                getContext().getValidationErrors().add("username", new SimpleError("Tento u�ivatel ji� existuje."));
View Full Code Here

TOP

Related Classes of eu.lsem.bakalarka.model.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.