lengths of database columns and other hibernate related fixes