Ispn 4599

Contains fixes for:
 - https://issues.jboss.org/browse/ISPN-2727
 - https://issues.jboss.org/browse/ISPN-4048
 - https://issues.jboss.org/browse/ISPN-4165
 - https://issues.jboss.org/browse/ISPN-4186
 - https://issues.jboss.org/browse/ISPN-4599

(Ultimately all caused by ISPN-4599)
which guidelines?
It looks good to me, but I'm used to the Hibernate style so I'm not sure.