You can access the Criteria API within EJB3 as follows (where manager is your EntityManager):
HibernateSession hs = (HibernateSession)manager;
Session session = hs.getHibernateSession();
Criteria criteria = session.createCriteria(Foo.class);
Is it JBoss specific?
yes, ejb3 does not have a criteria equivalent functionallity.
correction if JBoss refers to the JBoss server and not just our name.
fyi it is not dependent on a JBoss server just dependent on Hibernate Entitymanager which can be used independently
I see, I found this a very very helpful functionality, it is a pitty EJB3 could not create on the fly querys. So still hibernate is better than EJB!!