generate null check for fetch join mapping