I have a Data Class for Hibernate associated to a table; imagine the Entity Person like this:
@Entity @org.hibernate.annotations.Proxy(lazy=false)
Modified at runtime(I think it's the best way):
Session session = super.getSession(); SQLQuery query = session.createSQLQuery("raw sql"); query.setParameter(":abc", "value"); query.addEntity(Some.class); return query.list();