Thursday, 8 August 2013

How to return only one column in Hibernate?

How to return only one column in Hibernate?

I want to return only one column from table. This is my DAO:
@SuppressWarnings("unchecked")
public String getUri() {
return sessionFactory.getCurrentSession()
.createQuery("uri from Templates WHERE state=1").toString();
}
Console says:
Request processing failed; nested exception is
java.lang.IllegalArgumentException: node to traverse cannot be null!

No comments:

Post a Comment