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 use
| aSemester.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
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065025#4065025
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065025
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user