For queries like this, where no mapped objects have to be created, then yes, Hibernate is just as fast as using plain old jdbc, and the java code would be much simpler than anything jdbc would let you get away with:
Mapping file:
Code:
<query name="AnnotationValues">
select a.value from AnnotationClass a where geneid in (:GeneIDList)
</query>
Java code:
Code:
Query qry = session.findNamedQuery("AnnotationValues");
qry.setParameterList("GeneIDList", listGeneIds);
return qry.list();
This will return a List<String> (assuming that value is a String property).