Hello
How can i get values for some columns when i have mapped all columns from my table. Something like "select t.id, t.name from table t" (table has five another columns).
I know that it can be doing like this:
org.hibernate.Session session;
.....
session.createQuery("select new Table(t.id,t.name) from table t");
but i want to use "session.createCriteria()".
I think that i should implement my own "ResultTransformer" and use "dbSession.createCriter().setResultTransformer()". Is another way to do this ?
Best regards.
|