[
https://issues.jboss.org/browse/WFLY-10730?page=com.atlassian.jira.plugin...
]
Stephen Fikes commented on WFLY-10730:
--------------------------------------
The test can be built running {{'mvn clean package'}} and run by copying
{{./javaee-ear/target/javaee-ear-1.0-SNAPSHOT.ear}} to
{{<WFLY_HOME>/standalone/deployments}}.
The issue can be seen with the {{'managedUnit'}} on the console:
{code}
... SEVERE [support.jboss.ejb.session.SessionBean] (ServerService Thread Pool -- 89)
Failure accessing unit 'managedUnit':
org.hibernate.hql.internal.ast.QuerySyntaxException: Employee is not mapped [from Employee
e]
{code}
Scan for entities in persistence root when using unmanaged JPA
persistence unit
-------------------------------------------------------------------------------
Key: WFLY-10730
URL:
https://issues.jboss.org/browse/WFLY-10730
Project: WildFly
Issue Type: Enhancement
Components: JPA / Hibernate
Affects Versions: 13.0.0.Final
Reporter: Stephen Fikes
Assignee: Scott Marlow
Attachments: testcase.zip
Per the [JPA
specification|http://download.oracle.com/otn-pub/jcp/persistence-2_2-mrel...],
entities in the root should not need to be explicitly specified (they should be
automatically discovered). This works in a managed scenario (using injected entity
manager) but doesn't work in an un-managed case (entity manager factory / entity
manager created explicitly in application code) when using the same persistence unit.
Also attempted to work around the limitation by declaring an explicit scanner
({{hibernate.archive.scanner=org.jboss.as.jpa.hibernate5.HibernateArchiveScanner}}) but
this requires disabling managed JPA for the unit ({{jboss.as.jpa.managed=false}}) so a
single unit cannot be used in both managed and un-managed scenarios.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)