Package jpa.controllers.exceptions

Examples of jpa.controllers.exceptions.NonexistentEntityException


        } catch (Exception ex) {
            String msg = ex.getLocalizedMessage();
            if (msg == null || msg.length() == 0) {
                Integer id = courserates.getId();
                if (findCourserates(id) == null) {
                    throw new NonexistentEntityException("The courserates with id " + id + " no longer exists.");
                }
            }
            throw ex;
        } finally {
            if (em != null) {
View Full Code Here


            Courserates courserates;
            try {
                courserates = em.getReference(Courserates.class, id);
                courserates.getId();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The courserates with id " + id + " no longer exists.", enfe);
            }
            Enrollment enrollment = courserates.getEnrollment();
            if (enrollment != null) {
                enrollment.setCourserates(null);
                enrollment = em.merge(enrollment);
View Full Code Here

        } catch (Exception ex) {
            String msg = ex.getLocalizedMessage();
            if (msg == null || msg.length() == 0) {
                Integer id = tagrates.getId();
                if (findTagrates(id) == null) {
                    throw new NonexistentEntityException("The tagrates with id " + id + " no longer exists.");
                }
            }
            throw ex;
        } finally {
            if (em != null) {
View Full Code Here

            Tagrates tagrates;
            try {
                tagrates = em.getReference(Tagrates.class, id);
                tagrates.getId();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The tagrates with id " + id + " no longer exists.", enfe);
            }
            Coursetag courseTagId = tagrates.getCourseTagId();
            if (courseTagId != null) {
                courseTagId.getTagratesList().remove(tagrates);
                courseTagId = em.merge(courseTagId);
View Full Code Here

        } catch (Exception ex) {
            String msg = ex.getLocalizedMessage();
            if (msg == null || msg.length() == 0) {
                Integer id = courses.getCourseId();
                if (findCourses(id) == null) {
                    throw new NonexistentEntityException("The courses with id " + id + " no longer exists.");
                }
            }
            throw ex;
        } finally {
            if (em != null) {
View Full Code Here

            Courses courses;
            try {
                courses = em.getReference(Courses.class, id);
                courses.getCourseId();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The courses with id " + id + " no longer exists.", enfe);
            }
            List<String> illegalOrphanMessages = null;
            List<Enrollment> enrollmentListOrphanCheck = courses.getEnrollmentList();
            for (Enrollment enrollmentListOrphanCheckEnrollment : enrollmentListOrphanCheck) {
                if (illegalOrphanMessages == null) {
View Full Code Here

        } catch (Exception ex) {
            String msg = ex.getLocalizedMessage();
            if (msg == null || msg.length() == 0) {
                Integer id = lecture.getId();
                if (findLecture(id) == null) {
                    throw new NonexistentEntityException("The lecture with id " + id + " no longer exists.");
                }
            }
            throw ex;
        } finally {
            if (em != null) {
View Full Code Here

            Lecture lecture;
            try {
                lecture = em.getReference(Lecture.class, id);
                lecture.getId();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The lecture with id " + id + " no longer exists.", enfe);
            }
            Courses courseId = lecture.getCourseId();
            if (courseId != null) {
                courseId.getLectureList().remove(lecture);
                courseId = em.merge(courseId);
View Full Code Here

        } catch (Exception ex) {
            String msg = ex.getLocalizedMessage();
            if (msg == null || msg.length() == 0) {
                Integer id = user.getId();
                if (findUser(id) == null) {
                    throw new NonexistentEntityException("The user with id " + id + " no longer exists.");
                }
            }
            throw ex;
        } finally {
            if (em != null) {
View Full Code Here

            User user;
            try {
                user = em.getReference(User.class, id);
                user.getId();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The user with id " + id + " no longer exists.", enfe);
            }
            List<String> illegalOrphanMessages = null;
            List<Courses> coursesListOrphanCheck = user.getCoursesList();
            for (Courses coursesListOrphanCheckCourses : coursesListOrphanCheck) {
                if (illegalOrphanMessages == null) {
View Full Code Here

TOP

Related Classes of jpa.controllers.exceptions.NonexistentEntityException

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.