This content has been marked as final.
Show 2 replies
-
1. Re: dynamic filtering of resultlists
ellenzhao Jul 17, 2007 10:22 AM (in response to binabik)I would take this approach:
make a collection of lectures in the semester entity like this:@Entity @Name("semester") ... public class Semester implements Serializable{ ... //I assume the semester and lecture is n:n so needing a linking entity called // SemesterXLecture private Set<SemesterXLecture> lectures; @OneToMany // lazy or eager as you wish, I would prefer eager here ... public Set<SemesterXLecture> getLectures(){ return this.lectures; } }
Then, in one of your conversation beans, load all Semesters and cache them. Then, you can useaSemester.getLectures();
anywhere in your conversation beans. You can also hood a semester in your xhtml file and use it similar to this code:<h:dataTable value="#{someManager.semester.lectures}" var="lecture"> <h:column> <h:outputText value="#{lecture.desc}" /> </h:column> ... </h:dataTable>
so the lecture changes "dynamically" if you change the semester.
Regards,
Ellen -
2. Re: dynamic filtering of resultlists
ellenzhao Jul 17, 2007 10:25 AM (in response to binabik)sorry for my typos in the last post. I meant to cache all the semesters in a stateless bean, but not conversation bean.