public void create(User user) throws RollbackFailureException, Exception {
        if (user.getArticleList() == null) {
            user.setArticleList(new ArrayList<Article>());
        }
        EntityManager em = null;
        try {
            utx.begin();
            em = getEntityManager();
            List<Article> attachedArticleList = new ArrayList<Article>();
            for (Article articleListArticleToAttach : user.getArticleList()) {
                articleListArticleToAttach = em.getReference(articleListArticleToAttach.getClass(), articleListArticleToAttach.getArticleID());
                attachedArticleList.add(articleListArticleToAttach);
            }
            user.setArticleList(attachedArticleList);
            em.persist(user);
            for (Article articleListArticle : user.getArticleList()) {
                User oldAuthorIDOfArticleListArticle = articleListArticle.getAuthorID();
                articleListArticle.setAuthorID(user);
                articleListArticle = em.merge(articleListArticle);
                if (oldAuthorIDOfArticleListArticle != null) {
                    oldAuthorIDOfArticleListArticle.getArticleList().remove(articleListArticle);
                    oldAuthorIDOfArticleListArticle = em.merge(oldAuthorIDOfArticleListArticle);
                }
            }
            utx.commit();
        } catch (Exception ex) {
            try {
                utx.rollback();
            } catch (Exception re) {
                throw new RollbackFailureException("An error occurred attempting to roll back the transaction.", re);
            }
            throw ex;
        } finally {
            if (em != null) {
                em.close();
            }
        }
    }