display of data in combobox
jasti_jenny Aug 12, 2009 7:16 PMHi All,
I am new to Seam and even JSF and trying to display the data using h:selectOneMenu tag. I can access the data in the bean class using the following code
@Factory("workflowData") public void getWorkflowData() { workflowData = em.createQuery("from RpmUser u where u.userName like :username1") .setParameter("username1", "a%" ) .getResultList(); for(RpmUser us1: workflowData) { for(UserJournal uj: us1.getUserJournals()) { log.info("Journals"+ uj.getId().getJournal()); } } }
I have three entities RpmUser, RPMJournal, UserJournal. RpmUser entity has the following code
@OneToMany(fetch = FetchType.LAZY, mappedBy = "rpmUser") public Set<UserJournal> getUserJournals() { return this.userJournals; } public void setUserJournals(Set<UserJournal> userJournals) { this.userJournals = userJournals; }
I have UserJournalId class as UserJournal has composite keys. It has the following code:
@Embeddable public class UserJournalId implements java.io.Serializable { private String journal; private BigDecimal userId; public UserJournalId() { } public UserJournalId(String journal, BigDecimal userId) { this.journal = journal; this.userId = userId; } @Column(name = "JOURNAL", nullable = false, length = 3) @NotNull @Length(max = 3) public String getJournal() { return this.journal; } public void setJournal(String journal) { this.journal = journal; } @Column(name = "USER_ID", nullable = false, precision = 22, scale = 0) @NotNull public BigDecimal getUserId() { return this.userId; } public void setUserId(BigDecimal userId) { this.userId = userId; }
Can some one help me how to display the list of journals for a particular user in the front end, i tried but was not successful
Thanks.