* @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."));