michael wrote:
Where is your problem?
my problem is
Session session = HibernateUtil.getSession();
List zines = session.createCriteria(Foo.class)
.addOrder(Order.desc("registDate"))
.setMaxResults(5)
.list();
this code occured error...
net.sf.hibernate.QueryException: could not resolve property: ZinePopularPK.regDate of: com.haansoft.kaatal.model.dto.ZinePopular
at net.sf.hibernate.persister.AbstractPropertyMapping.toColumns(AbstractPropertyMapping.java:50)
at net.sf.hibernate.expression.AbstractCriterion.getColumns(AbstractCriterion.java:35)
at net.sf.hibernate.expression.Order.toSqlString(Order.java:37)
at net.sf.hibernate.loader.CriteriaLoader.<init>(CriteriaLoader.java:78)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3595)
at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:238)
of course this error is occured why Foo.java class have not 'registDate' variable that is located in FooPK.java class. [registDate is Primary Key]
so I can't order by registDate....