Hi!
I' trying to understand the function list() which I want to use on an org.hibernate.Query object.
Code:
public List getTranslationStringFor(MyObject object) throws InfrastructureException {
List queryResult = null;
try {
org.hibernate.Session sess = HibernateUtil.getSession();
String statement = getStatement("MyStatement",
new Object[] {
object.getType(), object.getUniqueId()}
);
org.hibernate.Query query = sess.createQuery(statement);
queryResult = query.list();
}
} catch (HibernateException e) {
throw new InfrastructureException(e);
}
return queryResult;
public String getStatement(String which, Object[] arguments) {
return MessageFormat.format(getStatement(which), arguments);
}
object.getType() and object.getId() each return strings.
Some get() methods of other classes are automatically called while running query.list(); But the objects of this methods are not mentioned in this context.
Can anyone try to explain to me why Hibernate uses these get Methods?
Thank you!