Classes Let s add the classes and to the model in stackoverflow klass Question has the primitive type The modifier is similar to a database s primary key The modifier on the property means that it s an auto incrementing number not a natural key has the primitive type with max length 150 has the primitive type with max length 30000 So far this exactly matches the real Stack Overflow Answer also has and but no has with the modifier It s private to the data layer it will be used as a foreign key Private properties cannot appear in projections so won t be part of service bodies neither request bodies nor response bodies Question Answer class Question id Long key id title String minLength 15 maxLength 150 body String maxLength 30000 id Long key id id title String body String class Answer id Long key id body String 30000 questionId Long private Answer id body title Answer questionId private questionId