Package com.evasion.exception

Examples of com.evasion.exception.PersistenceViolationException


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


        try {
            em.merge(newPartenaire.getPerson());
            newPartenaire = em.merge(newPartenaire);
            em.flush();
        } catch (Exception e) {
            throw new PersistenceViolationException("Erreur dans la validation. ", e.fillInStackTrace());
        }
        return newPartenaire;
    }
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

        Contribution result = null;
        try {
            result = em.merge(contribution);
        } catch (Exception e) {
            LOGGER.debug("Erreur de sauvegarde de la contribution: ", e);
            throw new PersistenceViolationException("Erreur dans la validation d'une contribution", e.fillInStackTrace());
        }
        return result;
    }
View Full Code Here

            } else {
                newPage = em.merge(newPage);
            }
            em.flush();
        } catch (Exception e) {
            throw new PersistenceViolationException("Erreur dans la validation de la page statique", e.fillInStackTrace());
        }
        return newPage;
    }
View Full Code Here

        return newPage;
    }

    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 = new UserDetailsService(em).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

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.