Package jpa.controllers.exceptions

Examples of jpa.controllers.exceptions.IllegalOrphanException


                }
                illegalOrphanMessages.add("The Enrollment " + enrollmentOrphanCheck + " already has an item of type Courserates whose enrollment column cannot be null. Please make another selection for the enrollment field.");
            }
        }
        if (illegalOrphanMessages != null) {
            throw new IllegalOrphanException(illegalOrphanMessages);
        }
        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
View Full Code Here


                    }
                    illegalOrphanMessages.add("The Enrollment " + enrollmentNew + " already has an item of type Courserates whose enrollment column cannot be null. Please make another selection for the enrollment field.");
                }
            }
            if (illegalOrphanMessages != null) {
                throw new IllegalOrphanException(illegalOrphanMessages);
            }
            if (enrollmentNew != null) {
                enrollmentNew = em.getReference(enrollmentNew.getClass(), enrollmentNew.getId());
                courserates.setEnrollment(enrollmentNew);
            }
View Full Code Here

                    }
                    illegalOrphanMessages.add("You must retain Enrollment " + enrollmentListOldEnrollment + " since its courseId field is not nullable.");
                }
            }
            if (illegalOrphanMessages != null) {
                throw new IllegalOrphanException(illegalOrphanMessages);
            }
            if (createrUserIdNew != null) {
                createrUserIdNew = em.getReference(createrUserIdNew.getClass(), createrUserIdNew.getId());
                courses.setCreaterUserId(createrUserIdNew);
            }
View Full Code Here

                    illegalOrphanMessages = new ArrayList<String>();
                }
                illegalOrphanMessages.add("This Courses (" + courses + ") cannot be destroyed since the Enrollment " + enrollmentListOrphanCheckEnrollment + " in its enrollmentList field has a non-nullable courseId field.");
            }
            if (illegalOrphanMessages != null) {
                throw new IllegalOrphanException(illegalOrphanMessages);
            }
            User createrUserId = courses.getCreaterUserId();
            if (createrUserId != null) {
                createrUserId.getCoursesList().remove(courses);
                createrUserId = em.merge(createrUserId);
View Full Code Here

                    }
                    illegalOrphanMessages.add("You must retain Enrollment " + enrollmentListOldEnrollment + " since its userId field is not nullable.");
                }
            }
            if (illegalOrphanMessages != null) {
                throw new IllegalOrphanException(illegalOrphanMessages);
            }
            List<Courses> attachedCoursesListNew = new ArrayList<Courses>();
            for (Courses coursesListNewCoursesToAttach : coursesListNew) {
                coursesListNewCoursesToAttach = em.getReference(coursesListNewCoursesToAttach.getClass(), coursesListNewCoursesToAttach.getCourseId());
                attachedCoursesListNew.add(coursesListNewCoursesToAttach);
View Full Code Here

                    illegalOrphanMessages = new ArrayList<String>();
                }
                illegalOrphanMessages.add("This User (" + user + ") cannot be destroyed since the Enrollment " + enrollmentListOrphanCheckEnrollment + " in its enrollmentList field has a non-nullable userId field.");
            }
            if (illegalOrphanMessages != null) {
                throw new IllegalOrphanException(illegalOrphanMessages);
            }
            em.remove(user);
            em.getTransaction().commit();
        } finally {
            if (em != null) {
View Full Code Here

                    illegalOrphanMessages = new ArrayList<String>();
                }
                illegalOrphanMessages.add("You must retain Commentrates " + commentratesOld + " since its comments field is not nullable.");
            }
            if (illegalOrphanMessages != null) {
                throw new IllegalOrphanException(illegalOrphanMessages);
            }
            if (commentratesNew != null) {
                commentratesNew = em.getReference(commentratesNew.getClass(), commentratesNew.getId());
                comments.setCommentrates(commentratesNew);
            }
View Full Code Here

                    illegalOrphanMessages = new ArrayList<String>();
                }
                illegalOrphanMessages.add("This Comments (" + comments + ") cannot be destroyed since the Commentrates " + commentratesOrphanCheck + " in its commentrates field has a non-nullable comments field.");
            }
            if (illegalOrphanMessages != null) {
                throw new IllegalOrphanException(illegalOrphanMessages);
            }
            Enrollment enrollmentId = comments.getEnrollmentId();
            if (enrollmentId != null) {
                enrollmentId.getCommentsList().remove(comments);
                enrollmentId = em.merge(enrollmentId);
View Full Code Here

                    }
                    illegalOrphanMessages.add("You must retain Comments " + commentsListOldComments + " since its enrollmentId field is not nullable.");
                }
            }
            if (illegalOrphanMessages != null) {
                throw new IllegalOrphanException(illegalOrphanMessages);
            }
            if (courseratesNew != null) {
                courseratesNew = em.getReference(courseratesNew.getClass(), courseratesNew.getId());
                enrollment.setCourserates(courseratesNew);
            }
View Full Code Here

                    illegalOrphanMessages = new ArrayList<String>();
                }
                illegalOrphanMessages.add("This Enrollment (" + enrollment + ") cannot be destroyed since the Comments " + commentsListOrphanCheckComments + " in its commentsList field has a non-nullable enrollmentId field.");
            }
            if (illegalOrphanMessages != null) {
                throw new IllegalOrphanException(illegalOrphanMessages);
            }
            User userId = enrollment.getUserId();
            if (userId != null) {
                userId.getEnrollmentList().remove(enrollment);
                userId = em.merge(userId);
View Full Code Here

TOP

Related Classes of jpa.controllers.exceptions.IllegalOrphanException

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.