[jboss-user] [JBoss Seam] - Re: selectOneMenu - NPE
w17chm4n
do-not-reply at jboss.com
Mon Nov 19 05:27:09 EST 2007
@Pete
Seam 2.0.0.GA
@Marius
Yes I`m sure that questionCategoryList is outjected. Anyway, this code works on Seam 1.2.1.GA...
questionCategory entity
| @Entity
| @Scope(ScopeType.EVENT)
| @Name("questionCategory")
| @Table(name="QuestionCategories")
| public class QuestionCategory implements Serializable {
|
| @Id @GeneratedValue
| private Long id;
|
| @NotNull @Length(min=3, max=100)
| private String categoryName;
|
| @OneToMany @JoinColumn(name="category_id")
| private List<Question> questionList;
|
| @Temporal(value = TemporalType.TIMESTAMP)
| private Date created;
|
| @Override
| public boolean equals(Object obj) {
| if (!(obj instanceof QuestionCategory) || this.id == null) {
| return false;
| }
|
| return this.id.equals(((QuestionCategory)obj).getId());
| }
|
| public QuestionCategory() {
| this.questionList = new ArrayList<Question>();
| }
|
| public QuestionCategory(String categoryName) {
| this.categoryName = categoryName;
| this.questionList = new ArrayList<Question>();
| }
|
| public Long getId() {
| return id;
| }
|
| public void setId(Long id) {
| this.id = id;
| }
|
| public String getCategoryName() {
| return categoryName;
| }
|
| public void setCategoryName(String categoryName) {
| this.categoryName = categoryName;
| }
|
| public List<Question> getQuestionList() {
| return questionList;
| }
|
| public void setQuestionList(List<Question> questionList) {
| this.questionList = questionList;
| }
|
| public Date getCreated() {
| return created;
| }
|
| public void setCreated(Date created) {
| this.created = created;
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105963#4105963
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105963
More information about the jboss-user
mailing list