http://www.mkyong.com/hibernate/hibernate-query-examples-hql/
Session session = HibernateUtil.getSessionFactory().openSession();
Query query = session.createQuery("from Actor where firstName = :firstName ");
query.setParameter("firstName", firstName);
List actors = query.list();
session.close();
return actors;
Anyways, I'm looking for a better way to use Hibernate without writing complex DAO's. I found a couple ways
http://blog.patouchas.net/technology/hibernate-dao-java-tutorial/
http://code.google.com/p/hibernate-generic-dao/
A bit later I finished that tutorial and also committed my project to git then pushed it to github.
No comments:
Post a Comment