Partner doesn't want to have kids

Hello everyone, and I really need an opinion about this one. I have a boyfriend of 4 years and we were planning to get married this year.

When we're having a conversation about family, turns out he didn't want to have kids. He said that he was afraid won't be a good dad. But what annoys me, HE LOVES CHILDREN.

He loves children, but why he didn't want to have one with his partner? And he didn't even tell me from the beginning of the relationship. Most of his friends already married and have kids and he even shows me the picture saying how cute those kids are.

But recently, he said it was okay for him to have kids because he saw me longing for having kids. But now I'm afraid he will neglect or hate the baby if I'm really getting pregnant, because he said he doesn't want to have a kid in the first place.

I just can't understand his way of thinking.... What should I do? :(