pain during sex

Hadent has sex in like a month. Yesterday it happened and I felt him hitting something I would say my cervix it hurt but I was able to  get through it, so sex wasn’t very enjoyable. After cleaning myself up etc... I started getting abdominal pain. It lasted for 20-30 minutes. Also cramps. The pain was bad where it made me loose my appetite for a bit. 
The last time I remember this happening was the time I lost my virginity. 
Not sure why it happened this time. 
Has this happened to anyone else?