[javaee-spec users] Re: rich domain models - injecting services into (JPA) beans

From: Linda DeMichiel <>
Date: Thu, 15 Nov 2012 17:54:45 -0800

Hi Jan,

Thanks for your input. I would encourage you to discuss this
issue on the JPA project users list,

JPA entities are light-weight domain objects, and do not
currently support injection, although injection into
entity listeners is supported as of JPA 2.1.



On 11/15/2012 5:41 PM, wrote:
> Hi,
> We are using a programming model that is inspired by rich
> domains/domain-driven design. Right now we're leveraging Spring's
> @Configurable concept, which combined with (a static) weave step allows
> us to have JPA/persistable beans that get injected with collaborating
> services. This works seamlessly for instance for entities that are the
> result of a query, or for entities we create (new) ourselves to be
> persisted later.
> Maybe this is not the right place to ask this question, but I wonder
> how I could accomplish something similar using JEE. I've asked a
> similar question at the Devoxx BOF yesterday evening, but got no
> clear/definitive answer.
> Thanks for any feedback,
> You're doing a great job.
> Jan.