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

2009-04-15 Thread skajotde
epbernard wrote : If we are OK to go the non standard route, I can look at adding a method on HibernateEntityManagerFactory. | SetClass? getEntities(); | returning the list of entities. | | Or even better you can do | | Collection metadatas = (Map) (

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

2009-04-07 Thread epbernard
If WB does check for @Entities and orm.xml it also needs to read the right META-INF/persistence.xml or a representation of it because: - classes might not be scanned - some non annotated class can be explicitly listed View the original post :

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

2009-04-07 Thread epbernard
If we are OK to go the non standard route, I can look at adding a method on HibernateEntityManagerFactory. SetClass? getEntities(); returning the list of entities. Or even better you can do Collection metadatas = (Map) ( (HibernateEntityManagerFactory) emf

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

2009-04-07 Thread pete.m...@jboss.org
epbernard wrote : If WB does check for @Entities and orm.xml it also needs to read the right META-INF/persistence.xml or a representation of it because: | - classes might not be scanned | - some non annotated class can be explicitly listed I would have to do a generic solution here I

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

2009-04-07 Thread pete.m...@jboss.org
I mean, is there some code I can take :-) View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4224051#4224051 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4224051 ___ jboss-user

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

2009-04-07 Thread epbernard
https://anonsvn.jboss.org/repos/hibernate/core/trunk/entitymanager/src/main/java/org/hibernate/ejb/packaging/PersistenceXmlLoader.java is your best shot. EnumerationURL xmls = Thread.currentThread() | .getContextClassLoader() |

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

2009-04-07 Thread wolfc
Alternatively, if you're on the VDF you can pick up the PersistenceMetaData attachment from the PerisistenceParsingDeployer. http://anonsvn.jboss.org/repos/jbossas/projects/jpa/trunk/deployers/src/main/java/org/jboss/jpa/deployers/PersistenceParsingDeployer.java View the original post :

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

2009-03-27 Thread wolfc
I disagree: The JPA consumer (AS / Embedded) has no facility to identify an entity. This is custom logic per JPA provider. For example the JPA provider could have a @WhopperEntity which is an extension to the standard @Entity (extra cheese). In which case we'll never find it. View the original

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

2009-03-27 Thread epbernard
So Carlo, Are you asking for a *standard* way to get the list of entities. ie a EntityManagerFactory.getEntities() This is not be easy to get for a few reasons, one of them being that you probably want to return some metadata model rather than the plain class and that it would take time to do

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

2009-03-27 Thread pete.m...@jboss.org
I agree with Carlo, whilst for the narrow scope of making WB spec compliant, I only need @Entity/orm.xml (i.e. spec'd entities) it would be much more user friendly to also extend this to provider specific entities (case in point is hbm.xml). If necessary for EE6/AS6 we can do a simple impl: *

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

2009-03-26 Thread epbernard
I've been thinking about it a bit more. Unfortunately, I don't think it should be the job of Hibernate to give that info. Here is my reasoning: - if an app uses 2 persistence providers (different), then you need to get the entities from both and an app server I think is required to work well

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

2009-03-26 Thread ALRubinger
Emmanuel, I agree; reporting entities is out of scope for Hibernate. Probably this reporting is best handled by some integration layer in AS, a central registry that we can expose via an MC bean maybe? The problem comes when we start talking about this notion of extra scanning (==time). As