Package entity

Examples of entity.Lecture


       
        //Sixth get lecture list
        List<Lecture> lectureList = course.getLectureList();
        ArrayList lectureMapList = new ArrayList();
        for (Iterator<Lecture> it = lectureList.iterator(); it.hasNext();) {
            Lecture lecture = it.next();
           
            Map lectureMap = new HashMap();
            lectureMap.put("lectureID", new Integer(lecture.getId()));
            lectureMap.put("lectureName", new String(lecture.getLectureName()));
            lectureMap.put("lectureLink", new String(lecture.getLink()));
            lectureMapList.add(lectureMap);
        }
       
        courseDetailMap.put("courseLectures", lectureMapList);
       
View Full Code Here


    public String getAsString(FacesContext context, UIComponent component, Object value) {
        if (value == null) {
            return null;
        }
        if (value instanceof Lecture) {
            Lecture o = (Lecture) value;
            return o.getId() == null ? "" : o.getId().toString();
        } else {
            throw new IllegalArgumentException("object " + value + " is of type " + value.getClass().getName() + "; expected type: entity.Lectures");
        }
    }
View Full Code Here

    public Lecture getLecture() {
        if(lecture == null) {
            lecture = (Lecture)JsfUtil.getObjectFromRequestParameter("jsfcrud.currentLectures", converter, null);
        }
        if(lecture == null) {
            lecture = new Lecture();
        }
        return lecture;
    }
View Full Code Here

    public void edit(Lecture lecture) throws NonexistentEntityException, Exception {
        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
            Lecture persistentLecture = em.find(Lecture.class, lecture.getId());
            Courses courseIdOld = persistentLecture.getCourseId();
            Courses courseIdNew = lecture.getCourseId();
            if (courseIdNew != null) {
                courseIdNew = em.getReference(courseIdNew.getClass(), courseIdNew.getCourseId());
                lecture.setCourseId(courseIdNew);
            }
View Full Code Here

    public void destroy(Integer id) throws NonexistentEntityException {
        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
            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);
            }
            em.remove(lecture);
View Full Code Here

TOP

Related Classes of entity.Lecture

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.