Skip to content

@Entity objects are not enhanced by the load time weaver in certain situations [SPR-8523] #13167

@spring-projects-issues

Description

@spring-projects-issues

Matt Young opened SPR-8523 and commented

I've boiled down a confusing situation into a reproducible odd behavior in the attached example application. In an OpenJPA-supported application when there are two classes (an abstract parent and a concrete child) that are both marked with @Entity, the classes are not enhanced when an autowired @Repository DAO is called from a unit test. The DAO contains an inserted @PersistenceContext to get access to the EntityManager.

If the call to the dao is commented out, the classes are enhanced as they should be.

Using spring-instrument-3.1.M2.jar on a -javaagent line.

Notes:

  • Run a mvn package with the dao call commented out and not commented out in the test class

  • Observe the difference in openjpa reporting the enhancement of classes vs. not enhancing them

  • It doesn't matter if you use a persistence.xml file or the new packagesToScan option in LocalContainerEntityManagerFactoryBean


Affects: 3.1 M2

Attachments:

Issue Links:

1 votes, 3 watchers

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)in: dataIssues in data modules (jdbc, orm, oxm, tx)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions