For a rich domain driven design I want to use Guice dependency injection on JPA/Hibernate entity beans. I am looking for a similar solution as the Spring @configurable annotation for non-Spring beans.
Does anybody know of a library? Any code examples?
You can do this with AspectJ.
Create the @Configurable annotation:
Create an AspectJ @Aspect similar to this:
Create (and use) a holding class for your injector:
Configure META-INF/aop.xml:
Start your VM with aspectjweaver:
Annotate your domain classes: