Generate doctrine