Update for Hibernate 4.2

So that these are all in the same place, here's a pull request for the 4.2 branch. There were a couple of changes required to get it working with Hibernate 4.2; the jpaEntityName needed to be set when creating PersistentClass, and the error reporting in the XMLHelper has changed.