Type casting when redefined in DB