严重: IllegalArgumentException in class
Hibernate: select news0_.NewsID as NewsID1_, news0_.AuthorNickName as AuthorNi2_1_, news0_.NewsTitle as NewsTitle1_, news0_.NewsContent as NewsCont4_1_, news0_.IssueTime as IssueTime1_, news0_.ClickNum as ClickNum1_, news0_.NewsTypeID as NewsTypeID1_ from tiantiannews.news news0_ inner join tiantiannews.newscomments newscommen1_ on news0_.NewsID=newscommen1_.NewsID where news0_.NewsTypeID=? order by newscommen1_.comTime desc limit ?
2008-7-23 22:48:46 org.hibernate.property.BasicPropertyAccessor$BasicGetter get
严重: IllegalArgumentException in class: com.hehe.hibernate.model.Newstype, getter method of property: newsTypeId
org.springframework.orm.hibernate3.HibernateSystemException: IllegalArgumentException occurred calling getter of com.hehe.hibernate.model.Newstype.newsTypeId; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.hehe.hibernate.model.Newstype.newsTypeId
Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.hehe.hibernate.model.Newstype.newsTypeId
-------------------------------------------
News类中:
private Newstype newsType;
public Newstype getNewsType() {
return this.newsType;
}
public void setNewsType(Newstype newsType) {
this.newsType = newsType;
}
news.hbm.xml中:
<many-to-one name="newsType" column="NewsTypeID"/>
news父类newstype类的xml:
<id name="newsTypeId" type="java.lang.Integer">
<column name="NewsTypeID" />
<generator class="native" />
</id>
...
<set name="news" inverse="true">
<key column="NewsTypeID"/>
<one-to-many class = "News"/>
</set>
---------------------------------
我查询的hql = "select news from News as news inner join news.newsComments as comment"+
" where news.newsType=?"+
" order by comment.comTime desc";
请问怎么解决啊?
都整一下午加一晚上了!
在线等待啊!