diff options
author | aclement <aclement> | 2010-01-25 22:47:06 +0000 |
---|---|---|
committer | aclement <aclement> | 2010-01-25 22:47:06 +0000 |
commit | d36b87d2f0b22991ffc8d111367fdb7c97943477 (patch) | |
tree | 85355c0aedc8e8b4ca4510f5d948e9bf94cc842f /tests/bugs169/pr295491 | |
parent | 046261e20078530352a063c6c1eef9f44bb98f23 (diff) | |
download | aspectj-d36b87d2f0b22991ffc8d111367fdb7c97943477.tar.gz aspectj-d36b87d2f0b22991ffc8d111367fdb7c97943477.zip |
292584, 295491, 298388: testcode
Diffstat (limited to 'tests/bugs169/pr295491')
-rw-r--r-- | tests/bugs169/pr295491/SpringConfigurableMixin.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/bugs169/pr295491/SpringConfigurableMixin.java b/tests/bugs169/pr295491/SpringConfigurableMixin.java new file mode 100644 index 000000000..bfcda0f81 --- /dev/null +++ b/tests/bugs169/pr295491/SpringConfigurableMixin.java @@ -0,0 +1,30 @@ +package com.j4fe.aspects; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.persistence.Entity; +import org.springframework.beans.factory.annotation.Configurable; +import org.springframework.beans.factory.annotation.Autowired; + +public aspect SpringConfigurableMixin { + + public static interface EntityManagerAware { + EntityManager getEntityManager(); + } + + + // not working + // declare @type : (@Entity *) : @Configurable(autowire = Autowire.BY_TYPE, preConstruction = true); + + // also not working + // declare @type : (@Entity *) : @Configurable + + declare parents : (@Entity *) implements EntityManagerAware; + + @PersistenceContext + transient private EntityManager EntityManagerAware.entityManager; + + public EntityManager EntityManagerAware.getEntityManager() { + return entityManager; + } +} |