Database queries mapping

Database queries mapping

I am looking for a solution to query my database, something else than an
Object/Relational Mapping Framework such Hibernate.
The reason is that we need to use Query Optimization tricks.
One expert told me that it exist another tool of mapping. It is about
having a file ( or many if we need to breakdown work) that contains the
needed queries, and of course those queries are written by a Database
Optimizer, this is the big advantage. Another advantage is the fact that
we can "re-use" them, and breaking down into files kind of :
student-queries.extension, book-queries.extension,... the thing which
would help the maintainability..
But, unfortunately the expert I talked to doesn't remember the name of the
Framework, and I didn't have his e-mail address...
So guys, does anybody have any idea about such Frameworks?
Thanks a lot!