Changed toFormattedString to use the hibernate hql formatter