Enhance layouts and fix incompatible bugs between joda-time and hibernate 4.0