Package com.evasion.exception

Examples of com.evasion.exception.PersistenceViolationException


     * {@inheritDoc }
     */
    @Override
    public StaticPage createPage(StaticPage page, String userName) throws PersistenceViolationException {
        if (page.getId() != null) {
            throw new PersistenceViolationException("Cette méthode ne peut être utilisé pour une page déja existente");
        }
        User user = userService.findUserByUserName(userName);
        page.setUser(user);
        return savePage(page);
    }
View Full Code Here


        LOGGER.debug("Create an account for user: {}", account.getUser().getUsername());
        try {
            accountDAO.persist(account);
        } catch (Exception e) {
            LOGGER.error("Erreur dans la validation du compte utilisateur", e);
            throw new PersistenceViolationException("Erreur dans la validation du compte utilisateur", e.fillInStackTrace());
        }
    }
View Full Code Here

        validGrantedAuthority(u);
        encodPassword(u);
        if (findAccountByUserName(u.getUsername()) == null) {
            em.persist(u);
        } else {
            throw new PersistenceViolationException("user already exists");
        }
        return u;
    }
View Full Code Here

            } else {
                newPage = em.merge(newPage);
            }
            em.flush();
        } catch (Exception e) {// @TODO revoir la gestion des erreurs car une erreur sur le username est masqué.
            throw new PersistenceViolationException("Erreur dans la validation de la page statique", e.fillInStackTrace());
        }
        return newPage;
    }
View Full Code Here

     * {@inheritDoc }
     */
    @Override
    public StaticPage createPage(StaticPage page, String userName) throws PersistenceViolationException {
        if (page.getId() != null) {
            throw new PersistenceViolationException("Cette méthode ne peut être utilisé pour une page déja existente");
        }
        return savePage(page);
    }
View Full Code Here

        LOGGER.debug("Create an account for user: {}", account.getUser().getUsername());
        try {
            em.persist(account);
            em.flush();
        } catch (Exception e) {
            throw new PersistenceViolationException("Erreur dans la validation du compte utilisateur", e.fillInStackTrace());
        }
        return account;
    }
View Full Code Here

    }
   
    @Override
    public Long savePromesse(Person p, Long l, String d) throws PersistenceViolationException {
        if (l == null || l <= 0L) {
            throw new PersistenceViolationException("le montant ne peut etre null ou <=0");
        }
        Don don = new Don(p, l, d);
        try {
            em.persist(don);
            em.flush();
            return don.getId();
        } catch (Exception e) {
            throw new PersistenceViolationException("Save promesse en Echec", e);
        }
    }
View Full Code Here

        UserDetailsAdapter.validGrantedAuthority(u);
        UserDetailsAdapter.encodPassword(u);
        if (findUserByUserName(u.getUsername())==null) {
        em.persist(u);
        } else {
            throw new PersistenceViolationException("user already exists");
        }
        return u;
    }
View Full Code Here

                return new UserDetailsAdapter(account);
            } else {
                return null;
            }
        } catch (Exception e) {
            throw new PersistenceViolationException("Erreur lors de l'identification du login '" + login + "' en persistence");
        }
    }
View Full Code Here

        try {
            em.persist(don);
            em.flush();
            return don.getId();
        } catch (Exception e) {
            throw new PersistenceViolationException("Save promesse en Echec", e);
        }
    }
View Full Code Here

TOP

Related Classes of com.evasion.exception.PersistenceViolationException

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.