added thread entity and thread mapper