I have an User Entity class that I\'m trying to do password hashing for. I thought that the easiest way to do this would be to create a password field annotated with @Transient
As mentioned in the above answer, this is by design in the spec. EclipseLink contains an event (postMerge) that is not part of the JPA spec that should be called in the right point in the cycle for you. In EclipseLink 2.1 The Descriptor Event Adaptor class can be registered using the regular @EventListeners annotation, pre 2.1 you will need to add the even using EclipseLink native API.
@EntityListeners({
a.b.MyEventListener.class,
})
package a.b;
import org.eclipse.persistence.descriptors.DescriptorEvent;
import org.eclipse.persistence.descriptors.DescriptorEventAdapter;
public class MyEventListener extends DescriptorEventAdapter {
public void postMerge(DescriptorEvent event) {
//event.getSession();
//event.getObject();
//event.getOriginalObject();
}
}