Generic routine to retrieve an object from a database record The object properties must match the database fields.