Avoid DB access in toString, hashCode and equals