Merge "Rework the hibernate adapter"