CDI Entity Listeners - EclipseLink [message #1700575] |
Fri, 03 July 2015 22:53 |
srijava srijavakanth Messages: 4 Registered: December 2014 |
Junior Member |
|
|
I am trying to do something like
https://wiki.eclipse.org/EclipseLink/Release/2.5/JPA21#CDI_Entity_Listeners
but non of my injections are working.
Does Entity Listener doesn't inject CDI dependencies ?
Do we have to do something different.
public class EntityListener {
@Inject
private UserUtility userUtility;
@PrePersist
public void prePersist(Object object) {
logger.log("prepersist", object);
}
@PostPersist
public void postPersist(Object object){
object.createUser(userUtility.getLoggedInUser())
}
}
But my userUtility is always null, I am using userUtility in different places in my project and It is properly injected. Just not in here.
Running this code in Glassfish 4.1 server. Eclipselink version on Glassfish is 2.5.2
Any clues, Please help me.
[Updated on: Fri, 03 July 2015 22:54] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02255 seconds