Add addJar() and addClassesFromPackage() to EntityManagerFactoryBuilder
-----------------------------------------------------------------------
Key: HHH-6483
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6483
Project: Hibernate Core
Issue Type: New Feature
Components: entity-manager
Affects Versions: 4.0.0.next
Reporter: Ondra Žižka
JPA's persistence.xml has <jar-file> :
{code}
<persistence>
<persistence-unit name="TestPU">
<jta-data-source>java:/TestDS</jta-data-source>
<jar-file>foo/bar/entities.jar</jar-file>
</persistence-unit>
</persistence>
{code}
It would be fine to have Ejb3Configuration.addClassesFromJar() with the same effect.
Also, Ejb3Configuration.addClassesFromPackage() would be handy, which would find
package-info.class and scan it's place (dir, jar, ...) for entities
(assuming a package is in one place only).
After HHH-6159, they would be EntityManagerFactoryBuilder.addClassesFromJar() and
EntityManagerFactoryBuilder.addClassesFromPackage(), respectively.
Without this feature, users tend to hack their own scanning or use external lib like
Scannotation, which is pitty since scanning code is already in Hibernate.
Thanks for considering.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira