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) (
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 :
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
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
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
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()
|
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 :
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
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
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:
*
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
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
12 matches
Mail list logo