Envers fix

Hi,

I prepared a fix for the Hibernate3 branch in order for the code to work with Envers.

Best regards, Matthias