[jboss-user] [EJB 3.0] - Re: Web Beans + JPA

epbernard do-not-reply at jboss.com
Tue Apr 7 09:18:50 EDT 2009

If we are OK to go the non standard route, I can look at adding  a method on HibernateEntityManagerFactory. 
Set<Class<?>> getEntities();
 returning the list of entities.

Or even better you can do

Collection metadatas = (Map) ( (HibernateEntityManagerFactory) emf ).getSessionFactory().getAllClassMetadata().values();

for(ClassMetadata metadata : metadatas) {
  Class<?> entityType = metadata.getMappedClass(EntityMode.POJO);
  if (entityType != null) 
    doStuffCauseItsAnEntity( entityType );

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4224044#4224044

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4224044

More information about the jboss-user mailing list