User development,
A new message was posted in the thread "Context Lookup vs. Injection":
http://community.jboss.org/message/522654#522654
Author : Andrig Miller
Profile :
http://community.jboss.org/people/andy.miller@jboss.com
Message:
--------------------------------------------------------------
I was playing around with the UUIDKeyGeneratorFactory in an EJB 3 application, to generate
a primary key. Hibernate actually supports its own annotations for this (non-JPA
standard), but I was wondering about using the KeyGeneratorFactory directly as an
alternative. I can definitely just create an IntialContext, and lookup
"UUIDKeyGeneratorFactory", and that works as expected, and that's been in
the application server since 3.2.x.
Is there a way to use EJB 3 @Resource annotation to inject the UUIDKeyGeneratorFactory. I
tried it in the code, but it didn't work, but maybe I missed something, or maybe the
@Resource annotation isn't generalized to lookup anything in JNDI.
Anyway, if someone could shed some light on the subject that would be helpful.
Thanks.
--------------------------------------------------------------
To reply to this message visit the message page:
http://community.jboss.org/message/522654#522654